installer - WiX: Managed to not overwrite config file during upgrade, however shortcuts are removed -
i have similar problem forki23 bring wix not overwrite configuration file during upgrade. have config file should not overwritten during upgrade, should removed during uninstall. every solution find, breaks else.
if set nooverwrite=yes , move removeexistingproducts installfinalize config file handled wished. however, in case shortcut removed during upgrade reason. if leave removeexistingproducts @ installinitialize, config file removed during upgrade, shortcuts present.
why happening , there way fix it?
<installexecutesequence> <removeexistingproducts after="installinitialize" /> <!-- installinitialize causes config-file disappear during upgrade --> <!-- installfinalize causes shortcuts disappear during upgrade -->
...
<property id="disableadvtshortcuts" value="1" />
...
<directory id="installlocation" name="myapp"> <component id="myapp.exe" diskid="1" guid="..."> <file id="myapp.exe" name="myapp.exe" source="..." vital="yes" keypath="yes"> <shortcut id="startmenushortcut" directory="programmenudir" name="!(loc.productname)" workingdirectory='installlocation' icon="icon.ico" iconindex="0" advertise="yes" /> </file> <registryvalue root="hklm" name="installlocation" key="$(var.installlocationregistrykey)" type="string" value="[installlocation]"> </registryvalue> </component> <component id="myapp.exe.config" diskid="1" guid="..." neveroverwrite="yes"> <file id="myapp.exe.config" name="myapp.exe.config" source="..." keypath="yes" /> </component> ... </directory>
...
<directory id="programmenufolder"> <directory id="programmenudir" name="!(loc.productprefix)"> <component id="programmenudir" guid="..."> <registryvalue root="hkcu" key="software\myapp" type="string" value="[installlocation]" keypath="yes" /> <removefolder id="programmenudir" on="uninstall"/> </component> </directory> </directory>
note a: config-file machine-wide configuration , should apply users.
note b: i'm using wix 3.7 , target plattform windows 7 , 8.
theoretically "nooverwrite=yes , move removeexistingproducts installfinalize" should work, s clear losing big picture. best method see why windows installer removes shortcuts create verbose log when launching upgrade setup. can in cmd.exe command: msiexec /i [msi path] /l*v debug.log
the post download link log , guids of components hosting shortcuts can see if log helps understand happens.
Comments
Post a Comment