How to access the setup.exe directory in an InstallScript in a Suite/Advanced UI project?
I am trying to create an installation setup for a program I wrote. The complete installer must contain:
- the installer for my program (created in a Simple MSI Project)
- the driver installers (Third party Executables)
- some configuration files, that will be copied under AppData. The idea with the configuration file is that our customers will be able to change these files and deliver "updated" version of the installer to their customers (same binaries, new configuration files) by themselves, without me or someone else opening the InstallShield project and updating the installer or creating a patch -> less work
I therefore created a Suite/Advanced UI Installation project with 1. and 2. as Packages and I want to handle 3. with an InstallScript Action, that would be triggered during installation of 1.. The InstallScript just need to search for a "Configurations" directory in the directory of the setup.exe and copy all of its content in AppData.
I found this post How-to-find-current-directory-where-the-install-file-resides and what I need seems to be either SRCDIR or PACKAGE_LOCATION.
I also found in Working with an Action that Runs InstallScript Code in a Suite/Advanced UI Installation that InstallScript run-time path variables (PROGRAMFILES, WINDIR, etc.) are not available for a Suite Project, therefore I also tried to work with the properties I found in Advanced UI and Suite/Advanced UI Property Reference .
What I tried:
TextSubGetValue("<PROGRAMFILES>", svValue, FALSE, FALSE); SuiteLogInfo("<PROGRAMFILES>: %s", svValue); TextSubGetValue("<SRCDIR>", svValue, FALSE, FALSE); SuiteLogInfo("<SRCDIR>: %s", svValue); TextSubGetValue("<PACKAGE_LOCATION>", svValue, FALSE, FALSE); SuiteLogInfo("<PACKAGE_LOCATION>: %s", svValue); GetCurrentDir(svValue); SuiteLogInfo("GetCurrentDir(): %s", svValue); SuiteGetProperty("SETUPEXEDIR", svValue); SuiteLogInfo("SETUPEXEDIR: %s", svValue);
What I got:
When I read the Logfile I get the following:
- I cannot get the Information I want from TextSubGetValue(),
- the SETUPEXEDIR property from SuiteGetProperty() gives me a temporary Directory back, also not what I want and
- I actually get the correct Directory from GetCurrentDir() but the GetCurrentDir documentation says I should rather use SRCDIR.
How can I safely get the Directory of the Setup.exe in a Suite / Advanced UI Project? Is there a better solution for my Problems?