Dynamically change Upgrade Code in Install Shield - msbuild

As said here and here, doing an upgrade with Install Shield is easy.
Did it, but I need something more - I need to change the Upgrade Code, of an upgrade, dynamically.
I have TeamCity, which builds my product with different Upgrade codes - this way I have different products, that I can install on same machine. I am doing it using InstallShieldPropertyOverrides in **.isproj* file. It works, but I want every single of those products to be upgradeable, so I need to change the Upgrade Code in Upgrades section (Orginize Your Setup > Upgrade Paths). I need it to be done dynamically, during build on TeamCity, but I found no InstallShield property in InstallShieldPropertyOverrides to be configured with MSBuild. Does anyone have an idea or solution?

Related

Does installing MsBuild tools change my old environment

I am tasked to upgrade our build environment as it is currently using a mix of VS2010 and VS2015 as I understand. I want to install the latest build tools and start updating the scripts but as I don't have a lot of experience and this build machine is used to do production builds I don't want to mess up the current environment in case it will take a lot of time for me to update everything.
So my question is if I can install the latest MsBuild tools without breaking anything like environment variables and such.
Also, how does ToolsVersion="Current" work? Is that set up in some environment variable through vsvars or similar?

How do you programatically find out where NuGet.exe is installled on a given machine?

Assuming that I have a script that will be run on a clean build server with Nuget.exe installed on it, what is the best way to programatically determine the path for where NuGet.exe is installed?
Is there a way to infer its location by going through NuGet.targets, or reading some sort of external config file, or following some sort of convention?
Note: The closest question I've seen so far is this one that points to where NuGet can be downloaded, but I'm not interested in downloading NuGet manually. I need a way to determine where it is installed, but I'm not sure if there's a convention that I can follow to determine where it might be installed.
In general, nuget.exe is not shipped with any product. Most people need to manually download it.
The only exception is for people who install Mono. Mono ships nuget.exe, but that's generally limited to people developing on Linux or Mac. But people who use .NET Core exclusively don't need Mono, even on Linux/Mac, so they won't have it either.
Few developers on Windows install Mono, so chances are you don't have a nuget.exe on your system unless you downloaded it yourself, or someone checked it into a repo that you cloned.

WiX Upgrade with custom versioning

I got a problem. I want to upgrade my app during installation process, but I run into problem with versioning. I use version number in format e.g. 5.5.789.0, some new version has version number in format 5.5.12.1. I know that installer only works with first three numbers from version so MajorUpgrade is not suitable for me. New version would not be installed in this case. Is there a way in which I can check versions in some custom action and plan upgrade from there? I cannot change the versioning as app building goes through some automatic post-processes that also works only with first three numbers and it is not possible to change that behavior.
Thanks for suggestions.
EDIT:
I am using WiX#.
It's not obvious to me why you can't use the WiX majorupgrade element. The settings would be AllowDowngrades=yes, maybe AllowSameVersionUpgrades=yes.
Using Schedule=afterInstallValidate is (as the docs say) removes the old product entirely before installing the new upgrade.

How to author a WiX Burn bundle including a ComPlus proxy installer

We have the scenario with an application with one .Net- and one VB6-client that should be deployed as a single bundle. The VB6 part on its hand contains its binaries as well as an ComPlus proxy. The proxy's installer is generated using COMAdminCatalog.ExportApplication. The three parts is bundled together with WiX Burn and uses the standard bootstrapper application. The creation of the bundle is part of an automatic build and deploy chain.
The problem is how to handle the proxy's installer in the bootstrapper.
There is no way of controlling the product- and upgrade code or version in COMAdminCatalog.ExportApplication. Thus a previous version can't be upgraded by a new. (At least I have not found a way, is there any?)
The msi generated from COMAdminCatalog.ExportApplication does not handle repair or reinstall. Will result in error and rollback of whole bundle.
Two versions of the proxy cannot be installed at the same time. Second one will result in error and rollback.
I have had some progress wrapping the complusproxy.msi in a bat script and use ExePackage instead of MsiPackage. The script begins with removing any previous version of the complusproxy. The problem with this is to get all different install/upgrade/uninstall-scenarios to work correctly.
I'm considering the option to edit the generated complusproxy.msi to get control of the upgrade code and version and add that to the build process.
It feels like I'm trying complex work arounds and it should be a correct, better way of doing it. What would be a better or good enough approach to solve it?

Is there a way to create a patch that is identical to doing a full install of the newer version?

I'm trying to create patches using the method from this tutorial. An issue I'm running into is that I can't install a new patch on top of a previous patch.
I can full install Version A,then patch to Version B. After that I can't patch to Version C.
I can full install Version B, then patch to Version C.
Currently we just do full installs with major updates each time which is working fine, but because of the frequency of our (internal) updates the file size and update time is becoming a burden so we're looking to reduce the update time (both downloading and installing) especially when most of the files don't change.
Edit: Another requirement is that at any given time a full install can be done instead of a patch. The solution I came up with setting a static product code made full installs on top (without manually uninstalling) doesn't work.
If you're not doing a major upgrade, but you are changing versions, you're doing a minor upgrade. To be able to install the next version .msi file over an existing installed previous version, you're going to have to set REINSTALL to a list of modified features somewhere (or to ALL if you're lazy and willing to put up with Windows Installer doing extra work). Often setting REINSTALL handled by the bootstrap, but it is possible to set it in the .msi and reset it to empty ({})when the previous versions are not installed (condition Not Installed).
Looks like the issue was that I was previously making all upgrades major upgrades, but that's not supported with patching. Changing to a static product code rather than auto-generate fixed it.
Edit:
Looks like it solved the first problem of Install A Patch B Patch C not working, but now trying to do a full install of D on top doesn't work.