Re: [WiX-users] Help passing properties to Rollback custom action.
El viernes, 20 de diciembre de 2013, escribió: Hello, I have a custom action that moves some deprecated files from an old install to a temp directory during a major upgrade and I have another custom action to move them back that runs only during roll back. I am having trouble accessing the two properties set by the first custom action in my rollback custom action every time I access the CustomActionData dictionary in my rollback action it is empty even though in the MSI log I can clearly see it got set to the proper values. Below are the custom action definitions: CustomAction Id=DeleteUserAdminDeprecatedFiles BinaryKey=FileSearchCA DllEntry=DeleteDeprecatedFiles Execute=immediate Return=check / CustomAction Id=RestoreDeprecatedFiles BinaryKey=FileSearchCA DllEntry=RestoreDeprecatedFiles Execute=rollback Return=ignore/ CustomAction Id=SetRollbackData Property=RestoreDeprecatedFiles Value=RootDir=[DEPRECATEDFILESROOTDIR];TempDir=[DEPRECATEDTEMPORARYDIR] / Below is the scheduling of the actions: Custom Action=SetRollbackData After=DeleteDeprecatedFiles OLD_VERSION_FOUND OR !--Run if we are doing a major upgrade (msi - msi).-- REMOVEINSTALLSHIELD /Custom Custom Action=DeleteDeprecatedFiles Before=InstallFinalize OLD_VERSION_FOUND OR !--Run if we are doing a major upgrade (msi - msi).-- REMOVEINSTALLSHIELD !--Run if we are upgrading installshield instance.-- /Custom Custom Action=RestoreDeprecatedFiles After=InstallInitialize/ Below are the relevant Log entries: MSI (s) (20:D4) [07:53:29:229]: Doing action: DeleteDeprecatedFiles Action 7:53:29: DeleteDeprecatedFiles. Action start 7:53:29: DeleteDeprecatedFiles. MSI (s) (20:2C) [07:53:29:237]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI2DDF.tmp, Entrypoint: DeleteDeprecatedFiles SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSI2DDF.tmp-\ SFXCA: Binding to CLR version v4.0.30319 Calling custom action FileSearchCA!FileSearchCA.FileSearchCA.DeleteDeprecatedFiles Starting UserAdmin delete deprecated files Custom Action. MSI (s) (20!A4) [07:53:29:413]: PROPERTY CHANGE: Adding DEPRECATEDFILESROOTDIR property. Its value is 'C:\Program Files\Duck Creek Technologies\ExampleUserAdmin\bin'. MSI (s) (20!A4) [07:53:29:417]: PROPERTY CHANGE: Adding DEPRECATEDTEMPORARYDIR property. Its value is 'C:\Users\LMUser\AppData\Local\Temp\kg2s3d3v.vqo'. Action ended 7:53:29: DeleteDeprecatedFiles. Return value 1. MSI (s) (20:D4) [07:53:29:458]: Doing action: SetRollbackData Action 7:53:29: SetRollbackData. Action start 7:53:29: SetRollbackData. MSI (s) (20:D4) [07:53:29:465]: PROPERTY CHANGE: Adding RestoreDeprecatedFiles property. Its value is 'RootDir=C:\Program Files\Duck Creek Technologies\ExampleUserAdmin\bin;TempDir=C:\Users\LMUser\AppData\Local\Temp\kg2s3d3v.vqo'. Action ended 7:53:29: SetRollbackData. Return value 1. MSI (s) (20:D4) [07:53:29:469]: Doing action: InstallFinalize Action 7:53:29: InstallFinalize. Rollback: RestoreDeprecatedFiles MSI (s) (20:D4) [07:55:19:904]: Executing op: ActionStart(Name=RestoreDeprecatedFiles,,) MSI (s) (20:D4) [07:55:19:906]: Executing op: CustomActionRollback(Action=RestoreDeprecatedFiles,ActionType=1345,Source=BinaryData,Target=RestoreDeprecatedFiles,) MSI (s) (20:60) [07:55:19:910]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIDE33.tmp, Entrypoint: RestoreDeprecatedFiles SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSIDE33.tmp-\ SFXCA: Binding to CLR version v4.0.30319 Calling custom action FileSearchCA!FileSearchCA.FileSearchCA.RestoreDeprecatedFiles Starting rollback for Deprecated files. Printing CustomActionData. Error in Rollback Deprecated files... System.Collections.Generic.KeyNotFoundException The given key was not present in the dictionary. at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at FileSearchCA.FileSearchCA.RestoreDeprecatedFiles(Session session) MSI (s) (20:D4) [07:55:20:578]: Executing op: End(Checksum=0,ProgressTotalHDWord=0,ProgressTotalLDWord=0) MSI (s) (20:D4) [07:55:20:581]: Error in rollback skipped. Return: 5 MSI (s) (20:D4) [07:55:20:611]: Note: 1: 2318 2: MSI (s) (20:D4) [07:55:20:614]: No System Restore sequence number for this installation. MSI (s) (20:D4) [07:55:20:616]: Unlocking Server MSI (s) (20:D4) [07:55:20:631]: PROPERTY CHANGE: Deleting UpdateStarted property. Its current value is '1'. Action ended 7:55:20: INSTALL. Return value 3. Also for good measure the
Re: [WiX-users] Help passing properties to Rollback custom action.
RestoreDeprecatedFiles was scheduled right after InstallInitialize. When that was run during the immediate or writing the script, the RestoreDeprecatedFiles property didn't (yet) exist (was blank), so that is what gets passed to the CA. Later on you create the value, but it is never used. You need to schedule SetRollbackData before RestoreDeprecatedFiles in the sequence. Since the values that SetRollbackData uses come from (I assume you are using DeleteDeprecatedFiles and not DeleteUserAdminDeprecatedFiles with the same attributes, based on your log) that action must come before SetRollbackData, which means you need that action to be After InstallInitialize instead of before InstallFinalize. -Blair From: tyler.w.r...@accenture.com To: wix-users@lists.sourceforge.net Date: Fri, 20 Dec 2013 16:30:29 + Subject: [WiX-users] Help passing properties to Rollback custom action. Hello, I have a custom action that moves some deprecated files from an old install to a temp directory during a major upgrade and I have another custom action to move them back that runs only during roll back. I am having trouble accessing the two properties set by the first custom action in my rollback custom action every time I access the CustomActionData dictionary in my rollback action it is empty even though in the MSI log I can clearly see it got set to the proper values. Below are the custom action definitions: CustomAction Id=DeleteUserAdminDeprecatedFiles BinaryKey=FileSearchCA DllEntry=DeleteDeprecatedFiles Execute=immediate Return=check / CustomAction Id=RestoreDeprecatedFiles BinaryKey=FileSearchCA DllEntry=RestoreDeprecatedFiles Execute=rollback Return=ignore/ CustomAction Id=SetRollbackData Property=RestoreDeprecatedFiles Value=RootDir=[DEPRECATEDFILESROOTDIR];TempDir=[DEPRECATEDTEMPORARYDIR] / Below is the scheduling of the actions: Custom Action=SetRollbackData After=DeleteDeprecatedFiles OLD_VERSION_FOUND OR !--Run if we are doing a major upgrade (msi - msi).-- REMOVEINSTALLSHIELD /Custom Custom Action=DeleteDeprecatedFiles Before=InstallFinalize OLD_VERSION_FOUND OR !--Run if we are doing a major upgrade (msi - msi).-- REMOVEINSTALLSHIELD !--Run if we are upgrading installshield instance.-- /Custom Custom Action=RestoreDeprecatedFiles After=InstallInitialize/ Below are the relevant Log entries: MSI (s) (20:D4) [07:53:29:229]: Doing action: DeleteDeprecatedFiles Action 7:53:29: DeleteDeprecatedFiles. Action start 7:53:29: DeleteDeprecatedFiles. MSI (s) (20:2C) [07:53:29:237]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI2DDF.tmp, Entrypoint: DeleteDeprecatedFiles SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSI2DDF.tmp-\ SFXCA: Binding to CLR version v4.0.30319 Calling custom action FileSearchCA!FileSearchCA.FileSearchCA.DeleteDeprecatedFiles Starting UserAdmin delete deprecated files Custom Action. MSI (s) (20!A4) [07:53:29:413]: PROPERTY CHANGE: Adding DEPRECATEDFILESROOTDIR property. Its value is 'C:\Program Files\Duck Creek Technologies\ExampleUserAdmin\bin'. MSI (s) (20!A4) [07:53:29:417]: PROPERTY CHANGE: Adding DEPRECATEDTEMPORARYDIR property. Its value is 'C:\Users\LMUser\AppData\Local\Temp\kg2s3d3v.vqo'. Action ended 7:53:29: DeleteDeprecatedFiles. Return value 1. MSI (s) (20:D4) [07:53:29:458]: Doing action: SetRollbackData Action 7:53:29: SetRollbackData. Action start 7:53:29: SetRollbackData. MSI (s) (20:D4) [07:53:29:465]: PROPERTY CHANGE: Adding RestoreDeprecatedFiles property. Its value is 'RootDir=C:\Program Files\Duck Creek Technologies\ExampleUserAdmin\bin;TempDir=C:\Users\LMUser\AppData\Local\Temp\kg2s3d3v.vqo'. Action ended 7:53:29: SetRollbackData. Return value 1. MSI (s) (20:D4) [07:53:29:469]: Doing action: InstallFinalize Action 7:53:29: InstallFinalize. Rollback: RestoreDeprecatedFiles MSI (s) (20:D4) [07:55:19:904]: Executing op: ActionStart(Name=RestoreDeprecatedFiles,,) MSI (s) (20:D4) [07:55:19:906]: Executing op: CustomActionRollback(Action=RestoreDeprecatedFiles,ActionType=1345,Source
[WiX-users] Help passing properties to Rollback custom action.
Hello, I have a custom action that moves some deprecated files from an old install to a temp directory during a major upgrade and I have another custom action to move them back that runs only during roll back. I am having trouble accessing the two properties set by the first custom action in my rollback custom action every time I access the CustomActionData dictionary in my rollback action it is empty even though in the MSI log I can clearly see it got set to the proper values. Below are the custom action definitions: CustomAction Id=DeleteUserAdminDeprecatedFiles BinaryKey=FileSearchCA DllEntry=DeleteDeprecatedFiles Execute=immediate Return=check / CustomAction Id=RestoreDeprecatedFiles BinaryKey=FileSearchCA DllEntry=RestoreDeprecatedFiles Execute=rollback Return=ignore/ CustomAction Id=SetRollbackData Property=RestoreDeprecatedFiles Value=RootDir=[DEPRECATEDFILESROOTDIR];TempDir=[DEPRECATEDTEMPORARYDIR] / Below is the scheduling of the actions: Custom Action=SetRollbackData After=DeleteDeprecatedFiles OLD_VERSION_FOUND OR !--Run if we are doing a major upgrade (msi - msi).-- REMOVEINSTALLSHIELD /Custom Custom Action=DeleteDeprecatedFiles Before=InstallFinalize OLD_VERSION_FOUND OR !--Run if we are doing a major upgrade (msi - msi).-- REMOVEINSTALLSHIELD !--Run if we are upgrading installshield instance.-- /Custom Custom Action=RestoreDeprecatedFiles After=InstallInitialize/ Below are the relevant Log entries: MSI (s) (20:D4) [07:53:29:229]: Doing action: DeleteDeprecatedFiles Action 7:53:29: DeleteDeprecatedFiles. Action start 7:53:29: DeleteDeprecatedFiles. MSI (s) (20:2C) [07:53:29:237]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI2DDF.tmp, Entrypoint: DeleteDeprecatedFiles SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSI2DDF.tmp-\ SFXCA: Binding to CLR version v4.0.30319 Calling custom action FileSearchCA!FileSearchCA.FileSearchCA.DeleteDeprecatedFiles Starting UserAdmin delete deprecated files Custom Action. MSI (s) (20!A4) [07:53:29:413]: PROPERTY CHANGE: Adding DEPRECATEDFILESROOTDIR property. Its value is 'C:\Program Files\Duck Creek Technologies\ExampleUserAdmin\bin'. MSI (s) (20!A4) [07:53:29:417]: PROPERTY CHANGE: Adding DEPRECATEDTEMPORARYDIR property. Its value is 'C:\Users\LMUser\AppData\Local\Temp\kg2s3d3v.vqo'. Action ended 7:53:29: DeleteDeprecatedFiles. Return value 1. MSI (s) (20:D4) [07:53:29:458]: Doing action: SetRollbackData Action 7:53:29: SetRollbackData. Action start 7:53:29: SetRollbackData. MSI (s) (20:D4) [07:53:29:465]: PROPERTY CHANGE: Adding RestoreDeprecatedFiles property. Its value is 'RootDir=C:\Program Files\Duck Creek Technologies\ExampleUserAdmin\bin;TempDir=C:\Users\LMUser\AppData\Local\Temp\kg2s3d3v.vqo'. Action ended 7:53:29: SetRollbackData. Return value 1. MSI (s) (20:D4) [07:53:29:469]: Doing action: InstallFinalize Action 7:53:29: InstallFinalize. Rollback: RestoreDeprecatedFiles MSI (s) (20:D4) [07:55:19:904]: Executing op: ActionStart(Name=RestoreDeprecatedFiles,,) MSI (s) (20:D4) [07:55:19:906]: Executing op: CustomActionRollback(Action=RestoreDeprecatedFiles,ActionType=1345,Source=BinaryData,Target=RestoreDeprecatedFiles,) MSI (s) (20:60) [07:55:19:910]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIDE33.tmp, Entrypoint: RestoreDeprecatedFiles SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSIDE33.tmp-\ SFXCA: Binding to CLR version v4.0.30319 Calling custom action FileSearchCA!FileSearchCA.FileSearchCA.RestoreDeprecatedFiles Starting rollback for Deprecated files. Printing CustomActionData. Error in Rollback Deprecated files... System.Collections.Generic.KeyNotFoundException The given key was not present in the dictionary. at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at FileSearchCA.FileSearchCA.RestoreDeprecatedFiles(Session session) MSI (s) (20:D4) [07:55:20:578]: Executing op: End(Checksum=0,ProgressTotalHDWord=0,ProgressTotalLDWord=0) MSI (s) (20:D4) [07:55:20:581]: Error in rollback skipped. Return: 5 MSI (s) (20:D4) [07:55:20:611]: Note: 1: 2318 2: MSI (s) (20:D4) [07:55:20:614]: