Is it possible to run a custom action only in repair mode

筅森魡賤 提交于 2019-12-28 07:05:11

问题


I need to run a custom action only during Repair. But I didn't find a valid condition to do so. If I specify a custom action with below condition, it runs in Modify mode as well as in Repair mode.

Installed AND Not REMOVE

I am using InstallShield 2012 spring.


回答1:


Check the REINSTALL property. Conditional statement on your custom action should look like REINSTALL<>""




回答2:


For future reference check these cheat sheets:

  • Installshield condition cheat sheet.
  • How to add a WiX custom action that happens only on uninstall (via MSI)?

I have not had the time to go through all these conditions and test them, but the latter table looks reasonable at face value. However:

I believe REMOVE can sometimes be set during installation for example (and change) - it is very complicated to deal with all permutations of possibilities since MSI's command line interface and property configuration is so flexible.

The Installshield cheat sheet I have never actively used or checked. Please check their suggestions for repair - there are different ones depending on how the repair is invoked.

Please remember to also check self-repair - just delete the main application EXE and trigger self-repair by then invoking the application's advertised shortcut (if any). It has been years since I checked, but self-repair may only run actions between InstallInitialize and InstallFinalize.




回答3:


REINSTALL="" will be evaluated to True during the install and uninstall phases so the exact condition is (Installed and NOT REMOVE) AND (REINSTALL="") because (Installed and NOT REMOVE) is True during Modify and repair operations but during repair REINSTALL property will be set to blank



来源:https://stackoverflow.com/questions/19533711/is-it-possible-to-run-a-custom-action-only-in-repair-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!