c# - Allow Upgrade of Application -
i trying allow upgrade of application. if user installs 1.0.0 next time release version can give them 1.1.0 , can install that. overwriting | removing | replacing first version
there should installed one version in control panel -> uninstall or change program.
my problems are:
if don't set product id equal * (use $(var.productid)" instead)
another version of product installed. installation of version can not continue ...
if set equal * installs new version , have 2 versions installed.
i have created simple wix application test this.
<?xml version="1.0" encoding="utf-8"?> <?define productversion="!(bind.fileversion.myassemblydll)"?> <?define upgradecode="f4d7f199-28f6-45d5-ad99-7c62938274be"?> <?define productid="{6408d956-40da-4aee-883e-5425f1562004}"?> <?define version="1.2.0"?> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <product id="$(var.productid)" name="upgradetest" language="1033" version="$(var.version)" manufacturer="xxx" upgradecode="$(var.upgradecode)"> <package installerversion="200" compressed="yes" installscope="permachine" /> <!-- prevents down gradeing --> <!-- 1 upgrade installes new version first removes old one. --> <majorupgrade downgradeerrormessage="a newer version of [productname] installed." schedule="afterinstallexecute"/> <mediatemplate embedcab="yes"/> <feature id="productfeature" title="upgradetest" level="1"> <componentgroupref id="productcomponents" /> </feature> </product> <fragment> <directory id="targetdir" name="sourcedir"> <directory id="programfilesfolder"> <directory id="installfolder" name="upgradetest" /> </directory> </directory> </fragment> <fragment> <componentgroup id="productcomponents" directory="installfolder"> <!-- todo: remove comments around component element , componentref below in order add resources installer. --> <component id="productcomponent"> <file id="product.wxs" source="product.wxs" keypath="yes" /> </component> </componentgroup> </fragment> </wix>
i have been trying work several days have exhausted tutorials far 2008. appreciated.
update:
<majorupgrade allowdowngrades="no" downgradeerrormessage="a newer version of [productname] installed." allowsameversionupgrades="no" />
bad: results in 2 versions in control panel.
update two:
<upgrade id ="$(var.productupgradecode)"> <upgradeversion minimum="$(var.productfullversion)" onlydetect="yes" property="newerversiondetected"/> <upgradeversion maximum="$(var.productfullversion)" includemaximum="no" property="olderversionbeingupgraded"/> </upgrade> <installexecutesequence> <removeexistingproducts after="installvalidate"/> </installexecutesequence> <condition message="a newer version of [productname] installed. if sure want downgrade, remove existing installation via programs , features.">not newerversiondetected</condition>
bad: results in 2 versions in control panel.
the way i've done using guid upgradecode
leaving id
of product @ *
. set reinstallation property amus
reinstall product way want.
it kind of this
<product id="*" name="yourproductname" language="1033" version="yourproductversion" manufacturer="yourcompany" upgradecode="{some-guid}"> <setproperty id="reinstallmode" value="amus" after="findrelatedproducts">installed , remove<>"all"</setproperty>
for amus
can refer microsoft documentation here careful, though. a
value reinstall application if installed 1 has newer version. figure out characters need installer.
Comments
Post a Comment