Home » C# Programming

How to get MSI installer path


I have created a .NET application with a custom installer, that all works fine.

After the installation process I need to access path of folder where the MSI installer / setup is located.

The problem I have is I cannot work out how to get the path for the MSI installer / setup.

Can anybody please help and advice me the best way to get this path while I am still inside the "Commmited" of the installer


2 Answers Found


Answer 1

Do you mean, for example, if the user installed from a DVD in drive H:\setup.exe, you need that info by your application?
If that is what you mean, I suspect you need to do this via a custom action saving [SOURCEDIR] property from the install process.


Answer 2

you can use the SourceDir property of the Windows Installer.
You can pass this info as a CustomAction in your deployment project : /SrcDir="[SourceDir]\"

You can then use it in c# with : this.Context.Parameters["SrcDir"]
or in vb with : Me.Context.Parameters("SrcDir")

Source: How to get MSI installer path



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure