Skip to content
Sep 7 / Michaël Hompus

Installer Application Folder

To deploy our code we create MSI installers using Visual Studio. One problem I encountered is that there is no property available in code to know where the user has chosen to install the application.
After some searching and testing I now use the following code to get the installation path:

 

// Installer Application Folderstring installPath = Context.Parameters["assemblypath"];installPath = installPath.Substring(0, installPath.LastIndexOf("\\"));

if (!installPath.EndsWith("\\")){    installPath += "\\";}

 

That’s all.

Leave a Comment