windows installer - WiX and ARPINSTALLLOCATION -
i want msi package write value installlocation
hkey_local_machine\software\\(wow6432node)\microsoft\windows\currentversion\uninstall\\(guid)
. should see value in add/remove programs control panel (column location
).
to set value via wix, read property arpinstalllocation should set custom action. reduced <product>
minimum. how looks like:
<?xml version="1.0" encoding="utf-8"?> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/utilextension"> <product id="*" name="myapplication" language="1033" version="!(bind.fileversion.myapplication.exe)" manufacturer="me" upgradecode="db37f5dc-68c5-46ee-bbdf-704ff68b70db"> <package installerversion="400" compressed="yes" installscope="permachine" languages="0" /> <majorupgrade downgradeerrormessage="a newer version of [productname] installed." /> <!-- use setproperty suggested rolo --> <setproperty id="arpinstalllocation" value="[installdir]" after="costfinalize" /> <feature id="productfeature" title="myapplication" level="1"> <componentgroupref id="myapplication.files.allrequired" /> </feature> </product> <fragment> <directory id="targetdir" name="sourcedir"> <directory id="programfilesfolder"> <directory id="installdir" name="myapplication" /> </directory> </directory> </fragment> <fragment> <componentgroup id="myapplication.files.allrequired"> <component id="productcomponent" guid="90ea8f1c-77d2-40e1-81ad-44b076efab9d" directory="installdir"> <file id="myapplication.exe" source="$(var.myapplication.targetdir)\myapplication.exe" /> </component> </componentgroup> </fragment> </wix>
the msi bundled within wix standard bootstrapper.
you should execute custom action in both sequences (installexecutesequence , installuisequence) , sequence after costfinalize.
you can simplify using this:
<setproperty id="arpinstalllocation" value="[installdir]" after="costfinalize" />
Comments
Post a Comment