Hello,
Sorry for the delayed reply on this.
Windows Installer can upgrade the original package only if the modified one has a higher version and a different Product Code. If you don't want to create a new version of the package, you need to uninstall the original MSI before installing the modified one.
If you follow your approach and change the ProductCode, you will have multiple versions of the same product installed on your machine. When the first three fields of the old and upgraded version are identical, then the upgrade installation will either fail with "Another version of this product is already installed" message or will be
installed side by side with the old version (when using different Product Codes).
If you do not want multiple installations of the same application and want to keep the same ProductVersion, you can use the "Uninstall a package with the same version (if found)" option from the Builds page and keep the same ProductCode. However, this option works only for EXE packages. If a package with the same product code and version as the current package is already installed, enabling this option will uninstall it.
You can also continue to use your current implementation with the Build Events. The new ProductCode will be reflected in the MSI if you changed it with a pre-build event. The expected behaviour is that it will not be updated in the UI when you have the project open and have modified it using the command line.
However, the ProductCode is actually updated at build time and this is reflected in the built MSI, but not in the UI.
- productcode build event.png (154.31 KiB) Viewed 6563 times
Let us know if you have any questions.
Best regards,
Liviu