I'm running a C# custom action (just a class library) that gets called from an InstallShield installer and I need access to the folder where the .exe was launched from. I've tried:
Directory.GetCurrentDirectory()
Environment.CurrentDirectory()
Application.StartupPath
Application.ExecutablePath
and they all return c:\windows\syswow64 - not the folder where the .exe was launched from. I'm guessing this is because the .dll is embedded in the .msi and that gets extracted to c:\windows\syswow64 (although it's hard to imagine that it really gets extracted there).
That's really all you need to know, but if you want more, I'm uninstalling prior versions that were written as InstallScript MSI projects and to uninstall them silently you need to provide "response files" (you'll need a Flexera account to follow that link), but it basically says that you need to "record" your uninstall actions into a response file and then pass that file to the msiexec uninstall using the syntax: setup.exe /s /f1"response file name"
. These response files are located in the installer folder and that's why I need to know what that folder is. Anyone know of a way to get a reference to this folder?