Get installation dir in Visual Studio setup within bootstrapper

1 week ago 14
ARTICLE AD BOX

I'm using a bootstrapper project that is used for 3 different Visual Studio setup projects (.msi). In the end, I have 3 Setup.exe files. I need the path of the installdir of the msi, because I want to start the software after installation.

In the VS setup projects, the DefaultLocation of the application folder is set to:

[LocalAppDataFolder]\Text\[ProductName]` (project 1) [LocalAppDataFolder][Manufacturer]\[ProductName]`(projects 2-3)

Unfortunately project 1 is always installed to:

AppData\Local\Programs\Text\\[ProductName]

whereas the other projects are installed to:

AppData\Local\Manufacturer\\[ProductName]

(so it's not within Programs).

My idea was to read the TargetDir or InstallDir that is internally set in the msi using the bootstrapper.

I tried manipulating the .vdproj file and set:

"ARPINSTALLLOCATION" = "8:[INSTALLDIR]"

But that is always deleted when the project is rebuild.

Is there another way to get the "msi predefinded" installation dir? I don't trust the DefaultLocation anymore and I am not sure if the path is always set as shown above or if this may vary beetween systems.

Alternatively I could of course just search the whole AppData\Local folder for the product name.

Read Entire Article