Re: [WiX-users] Custom Action Rollback Implementation

2008-01-18 Thread Richard

In article <[EMAIL PROTECTED]>,
"Daryn Mitchell" <[EMAIL PROTECTED]>  writes:

> Richard is right that your primary issue to that your CA has to be deferred
> if you want your rollback action to get written to the rollback script.

Right, I forgot to mention that the ICE I wrote checked that the CA
action *and* its rollback were both deferred and also:

> I wanted to add that the condition for your rollback action should be the
> same as the deferred action that you want to roll back.

it checked this too :-).

ICEs are your friend.  They can find so many of these little details
that you can easily get wrong.  I found that adopting a few naming
conventions for your identifiers in the MSI tables can help you write
additional checks on your data that the normal ICEs can't assume.
(i.e. they can't assume that because the action's key is MyRollbackFoo
that this is an action intended to rollback the MyFoo action.)
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
  

Legalize Adulthood! 

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] Custom Action Rollback Implementation

2008-01-18 Thread Daryn Mitchell
> -Original Message-
> From: Sneha Gharpure
> 
> the "WriteToRegistry" action is called only during the 
> installation and therefore the condition " Not Installed".
> I am not sure about the condition for "WriteToRegistry_Rollback".
> I have tried both- "Installed" and "Not Installed"
> 
> 
>Not Installed
> 
> 
>Installed
> 

Richard is right that your primary issue to that your CA has to be deferred
if you want your rollback action to get written to the rollback script.

I wanted to add that the condition for your rollback action should be the
same as the deferred action that you want to roll back.
I.e. if WriteToRegistry's condition is 'Not Installed', then you want to use
'Not Installed' for WriteToRegistry_Rollback too. When you get to the action
and the condition 'Not Installed' is true, the rollback custom action
doesn't fire right away, it gets written to the rollback script. It will
then be executed if the install rolls back.

For a helpful overview see "Installation Phases and In-Script Execution
Options for Custom Actions in Windows Installer" on Stefan Krueger's site.
http://www.installsite.org/pages/en/isnews/200108/index.htm

Daryn.



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] Custom Action Rollback Implementation

2008-01-18 Thread Richard

In article <[EMAIL PROTECTED]>,
Sneha Gharpure <[EMAIL PROTECTED]>  writes:

> Creating a registry entry is just an example.
> My question is, if suppose I have a custom action which is an "immediate"
> custom action and if I want to add a rollback for that custom action, how do
> I add it and what is the correct sequence for that?

Anything that modifies the system should be a deferred custom action
and not immediate.  The rollback action for a deferred custom action
should be sequenced before the custom action so that it is written
into the rollback script before the system is modified by the deferred
custom action.  I enforced this constraint by writing an ICE and using
a naming convention for custom actions that could check the proper
sequencing.  i.e. use MyFoo for the name of the custom action and
MyRollbackFoo for the name of the rollback action.  The ICE can then
validate that MyRollbackFoo is a rollback CA and that it is sequenced
in the execute sequence before MyFoo.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
  

Legalize Adulthood! 

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] Custom Action Rollback Implementation

2008-01-18 Thread Sneha Gharpure



Sneha Gharpure wrote:
> 
> Hi,
> 
> Thanks for your reply.
> 
> Creating a registry entry is just an example.
> My question is, if suppose I have a custom action which is an "immediate"
> custom action and if I want to add a rollback for that custom action, how
> do I add it and what is the correct sequence for that?
> 
> Thanks,
> Sneha
> 
> 
> diwakar09 wrote:
>> 
>> Hi,
>>   I didn't understand your question, 
>> What i have understood is- you want to write to registry and you want to
>> delete that value from registry,
>> 
>> If you want to write to registry 
>> Try this
>> > Root="HKLM" Key="SOFTWARE\Application_name\version">
>> > Type="string" />
>>   
>> 
>> And on uninstallation it will automatically remove it from the registry,
>> 
>> 
>> Sneha Gharpure wrote:
>>> 
>>> I have a custom action writeToRegistry and after this action if the user
>>> presses cancel, the corresponding value should be deleted from the
>>> registry.
>>> 
>>> Following is the sample code showing how we have implemented it.
>>> 
>>> WriteToRegistry -> writes a value to a registry
>>> DeleteFromRegistry -> deletes a value from registry
>>> These two are VB scripts that read/write the values from/to the
>>> registry.
>>> 
>>> >> VBScriptCall='WriteToRegistry' Execute="immediate" />
>>> >> VBScriptCall='DeleteFromRegistry' Execute="rollback" />
>>> 
>>> 6402 is the sequence number after "publish product"
>>> the "WriteToRegistry" action is called only during the installation and
>>> therefore the condition " Not 
>>> Installed". I am not sure about the condition for
>>> "WriteToRegistry_Rollback". I have tried both- "Installed" and "Not
>>> Installed"
>>> 
>>> 
>>>Not Installed
>>> 
>>> 
>>>Installed
>>> 
>>> 
>>> The problem here is that the Roll back custom action is not getting
>>> called when the user presses "cancel" after executing the
>>> "WriteToRegistry" action. I think that the problem is due to improper
>>> sequencing of these custom actions. 
>>> 
>>> Can anyone give any pointer?
>>> 
>>> Thanks in Advance,
>>> Sneha
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Custom-Action-Rollback-Implementation-tp14948042p14949622.html
Sent from the wix-users mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] Custom Action Rollback Implementation

2008-01-18 Thread Sneha Gharpure

Hi,

Thanks for your reply.

Creating a registry entry is just an example.
My question is, if suppose I have a custom action which is an "immediate"
custom action and if I want to add a rollback for that custom action, how do
I add it and what is the correct sequence for that?

Thanks,
Sneha


diwakar09 wrote:
> 
> Hi,
>   I didn't understand your question, 
> What i have understood is- you want to write to registry and you want to
> delete that value from registry,
> 
> If you want to write to registry 
> Try this
>  Root="HKLM" Key="SOFTWARE\Application_name\version">
>  Type="string" />
>   
> 
> And on uninstallation it will automatically remove it from the registry,
> 
> 
> Sneha Gharpure wrote:
>> 
>> I have a custom action writeToRegistry and after this action if the user
>> presses cancel, the corresponding value should be deleted from the
>> registry.
>> 
>> Following is the sample code showing how we have implemented it.
>> 
>> WriteToRegistry -> writes a value to a registry
>> DeleteFromRegistry -> deletes a value from registry
>> These two are VB scripts that read/write the values from/to the registry.
>> 
>> > VBScriptCall='WriteToRegistry' Execute="immediate" />
>> > VBScriptCall='DeleteFromRegistry' Execute="rollback" />
>> 
>> 6402 is the sequence number after "publish product"
>> the "WriteToRegistry" action is called only during the installation and
>> therefore the condition " Not 
>> Installed". I am not sure about the condition for
>> "WriteToRegistry_Rollback". I have tried both- "Installed" and "Not
>> Installed"
>> 
>> 
>>Not Installed
>> 
>> 
>>Installed
>> 
>> 
>> The problem here is that the Roll back custom action is not getting
>> called when the user presses "cancel" after executing the
>> "WriteToRegistry" action. I think that the problem is due to improper
>> sequencing of these custom actions. 
>> 
>> Can anyone give any pointer?
>> 
>> Thanks in Advance,
>> Sneha
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Custom-Action-Rollback-Implementation-tp14948042p14949459.html
Sent from the wix-users mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] Custom Action Rollback Implementation

2008-01-18 Thread diwakar09

Hi,
  I didn't understand your question, 
What i have understood is- you want to write to registry and you want to
delete that value from registry,

If you want to write to registry 
Try this


  

And on uninstallation it will automatically remove it from the registry,


Sneha Gharpure wrote:
> 
> I have a custom action writeToRegistry and after this action if the user
> presses cancel, the corresponding value should be deleted from the
> registry.
> 
> Following is the sample code showing how we have implemented it.
> 
> WriteToRegistry -> writes a value to a registry
> DeleteFromRegistry -> deletes a value from registry
> These two are VB scripts that read/write the values from/to the registry.
> 
>  VBScriptCall='WriteToRegistry' Execute="immediate" />
>  VBScriptCall='DeleteFromRegistry' Execute="rollback" />
> 
> 6402 is the sequence number after "publish product"
> the "WriteToRegistry" action is called only during the installation and
> therefore the condition " Not 
> Installed". I am not sure about the condition for
> "WriteToRegistry_Rollback". I have tried both- "Installed" and "Not
> Installed"
> 
> 
>Not Installed
> 
> 
>Installed
> 
> 
> The problem here is that the Roll back custom action is not getting called
> when the user presses "cancel" after executing the "WriteToRegistry"
> action. I think that the problem is due to improper sequencing of these
> custom actions. 
> 
> Can anyone give any pointer?
> 
> Thanks in Advance,
> Sneha
> 

-- 
View this message in context: 
http://www.nabble.com/Custom-Action-Rollback-Implementation-tp14948042p14949367.html
Sent from the wix-users mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


[WiX-users] Custom Action Rollback Implementation

2008-01-18 Thread Sneha Gharpure

I have a custom action writeToRegistry and after this action if the user
presses cancel, the corresponding value should be deleted from the registry.

Following is the sample code showing how we have implemented it.

WriteToRegistry -> writes a value to a registry
DeleteFromRegistry -> deletes a value from registry
These two are VB scripts that read/write the values from/to the registry.




6402 is the sequence number after "publish product"
the "WriteToRegistry" action is called only during the installation and
therefore the condition " Not 
Installed". I am not sure about the condition for
"WriteToRegistry_Rollback". I have tried both- "Installed" and "Not
Installed"


   Not Installed


   Installed


The problem here is that the Roll back custom action is not getting called
when the user presses "cancel" after executing the "WriteToRegistry" action.
I think that the problem is due to improper sequencing of these custom
actions. 

Can anyone give any pointer?

Thanks in Advance,
Sneha
-- 
View this message in context: 
http://www.nabble.com/Custom-Action-Rollback-Implementation-tp14948042p14948042.html
Sent from the wix-users mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users