Setting PRODUCTCODE at runtime (via commandline)
Posted: Tue Sep 08, 2009 10:21 pm
The Transform Instance allows multiple instances of the same product to be installed ... but it "loses" any links to the multiple installs. i.e. when you try to install a newer version of one of the instances, the user must manually first find and uninstall the previous instance, then re-run the setup and specifiy all the same settings (program group, folder etc).
I was wondering if, instead, we could just change the PRODUCTCODE in the script at the beginning, perhaps from a command line parm from the user running the setup. Then the user could completely manage multiple instances by using something like:
MySetup.exe /UNIQUE_GUID=Install_1
and
MySetup.exe /UNIQUE_GUID=Install_2
... and then when we release new versions of the product (and a new installer), they simply re-run
MySetup.exe /UNIQUE_GUID=Install_1
and
MySetup.exe /UNIQUE_GUID=Install_2
and the great InstallAware logic will uninstall the correct (the correct instance) previous version, and then install the new version.
I just tried just setting the PRODUCTCODE and TITLE manually at the start of the script (to some "dummy value"), and it ALMOST works. But when it comes time to uninstall the previous version when I run a new setup version, the Install/Remove MSO Package in the NEEDSUPGRADE section fails with, the "parameter is incorrect"
The Add/Remove Programs entry works fine ... but kicking off the uninstall of the previous version from inside the script always fails. There is probably some registry settings in the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall
that are a little messed up.
Is there a way to accomplish what I am trying to do? Do you know why the Install/Remove MSO Package could fail? Is there a different method to remove the previous version based on a runtime generated PRODUCTCODE?
Thanks!
I was wondering if, instead, we could just change the PRODUCTCODE in the script at the beginning, perhaps from a command line parm from the user running the setup. Then the user could completely manage multiple instances by using something like:
MySetup.exe /UNIQUE_GUID=Install_1
and
MySetup.exe /UNIQUE_GUID=Install_2
... and then when we release new versions of the product (and a new installer), they simply re-run
MySetup.exe /UNIQUE_GUID=Install_1
and
MySetup.exe /UNIQUE_GUID=Install_2
and the great InstallAware logic will uninstall the correct (the correct instance) previous version, and then install the new version.
I just tried just setting the PRODUCTCODE and TITLE manually at the start of the script (to some "dummy value"), and it ALMOST works. But when it comes time to uninstall the previous version when I run a new setup version, the Install/Remove MSO Package in the NEEDSUPGRADE section fails with, the "parameter is incorrect"
The Add/Remove Programs entry works fine ... but kicking off the uninstall of the previous version from inside the script always fails. There is probably some registry settings in the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall
that are a little messed up.
Is there a way to accomplish what I am trying to do? Do you know why the Install/Remove MSO Package could fail? Is there a different method to remove the previous version based on a runtime generated PRODUCTCODE?
Thanks!