- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to access the setup.exe directory in an InstallScript in a Suite/Advanced UI project?
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
How to access the setup.exe directory in an InstallScript in a Suite/Advanced UI project?
Hello,
My objectives:
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
The idea:
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.
The Problem:
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.
Questions:
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?
Many thanks,
Pierre