installer - Why do I need to specify a new guid for a version upgrade in wix -
i've updated our wix install scripts per previous question/answer how implement wix installer upgrade?. idea prevent older version 'downgrading' newer version. have parts of wix file like:
<product id="a_guid" <upgrade id="18626be5-521c-4b58-ab8a-54baddf66679"> <upgradeversion property="newerversiondetected" minimum="$(var.version)" includeminimum="no" onlydetect="yes" excludelanguages="yes" /> </upgrade> <customaction id="newerversionfound" error="can't downgrade." /> <installexecutesequence> <custom action="newerversionfound" after="findrelatedproducts">newerversiondetected</custom> <removeexistingproducts after="installinitialize" /> </installexecutesequence>
i have 2 versions of this, 2.1 , 2.2. current practice keep product id guid (shown 'a_guid' above) same minor versions (like 2.x) , change major - moving 1.x 2.x change guid.
but, above doesn't work if product guid kept same 2.1 , 2.2, despite '$(var.version)' changing. if change guid, work (and prevents downgrade 2.2 -> 2.1).
i wondering why case (assuming i'm doing correctly) - why need 2 bits of information (guid , version) work?
edit1a: there upgradecode guid in wix, stays same each version. edit1b: if it's relevant, done old version of wix (2.x).
its not related product guid.
it related upgradecode specify attribute @ product node.
<product id="*" name="name" version="$(var.version)" upgradecode="12345678-55f7-4731-a318-772ef75d2830">
within upgrade node looking upgradecode (and not product guid). can specify multiply upgradecodes find different versions of software. upgradecode should stay same in product. see best practices on ms homepage, please.
<upgrade id="12345678-55f7-4731-a318-772ef75d2830"> <upgradeversion excludelanguages="no" property="oldversionfound" ignoreremovefailure="yes" migratefeatures="no" includeminimum="no" minimum="0.0.0.0" maximum="$(var.version)" includemaximum="no" /> <upgradeversion onlydetect="yes" property="newappfound" includeminimum="yes" minimum="$(var.version)" maximum="99.99.99.99" /> </upgrade>
with custom action (you have) react on that.
<customaction id="oldappfound" error="newer app of [productname] installed" />
ofcurse need schedule tests in sequences (you did)
<installexecutesequence> <custom action="oldappfound" after="findrelatedproducts">newappfound</custom> </installexecutesequence> <installuisequence> <custom action="oldappfound" after="findrelatedproducts">newappfound</custom> </installuisequence>
and if necessary remove old 1 (you have in code)
<installexecutesequence> <removeexistingproducts after="installinitialize" /> </installexecutesequence>
Comments
Post a Comment