Hi I have an installer that GACs a number of assemblies. Once this is done, I need to run a C# custom action (currently, this is an EXE). The problem is that this CA depends on one of the assemblies that was installed to the GAC earlier. The custom action modifies a file on disk. I know having managed code CAs are not ideal, but for now there is no real alternatives.
At the moment, I have the custom actions defined as <CustomAction Id="CA_Install" BinaryKey="CA_BIN" ExeCommand="-i" Execute="commit" Return="check"/> <CustomAction Id="CA_Remove" BinaryKey="CA_BIN" ExeCommand="-u" Execute="commit" Return="check"/> <InstallExecuteSequence> <Custom Action="CA_Install" Before="InstallFinalize">NOT INSTALLED OR REINSTALL="ALL"</Custom> <Custom Action="CA_Remove" Before="InstallFinalize">REMOVE="ALL"</Custom> </InstallExecuteSequence> I've also add the WixFailWhenDeferred action to allow for injecting failures. I found that since it relies on the GAC, having Execute="commit" seems to work well by making sure the assemblies are in the GAC since this happens after the publishAssembly steps. What I'm wondering is how should I deal with the following: - During an install, the custom action runs, but something after it goes wrong. The file on disk is potentially modified, but now needs to be rolled back, so I need to schedule the CA_Remove action. - During an uninstall, the custom action runs, but something goes wrong again. The file has been reverted, but since the uninstall is rolling back, the file needs to be updated to leave the machine in an installed state. - Future versions of the installer may perform additional modifications to the file on disk. In this case I might be required to schedule additional actions, or existing actions with different parameters. Questions - Which additional conditions should be added to cover rollback scenarios for install/uninstall? - Would conditioning my CAs based on properties set by my <UpgradeVersion> elements be sufficient to deal with upgrade scenarios? - <RemoveExistingProducts> is scheduled after InstallInitialze, so it always does a full removal of a product before installing the newer version. I think this might be enough to deal with upgrades and not be concerned about potential failures. Thanks, Jacques ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users