- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- passing data to a InstallScript 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
Hello,
I have an InstallScript Project (not MSI).
We create a logfile using GLOBAL variables, i.e.:
#ifndef CULOGFOLDER
#define CULOGFOLDER FOLDER_COMMON_APPDATA ^ "MyCompany\\Installation\\"
#endif
#define LOGNAME "MyLogFile.log"
I have a function CreateLogFile() that is called in OnBegin()
We want to be able to allow the customers to create the logfile in a custom folder, instead of in the default C:\ProgramData\MyCompany\Installation folder.
Within the CreateLogFile() method we tack on a folder name that has the date_time :
GetSystemInfo(DATE,nvResult, svDate);
GetSystemInfo(TIME,nvResult,svTime);
StrReplace(svTime,":","",0);
svFolderName = "CUUpdate" + "_" + svDate + "_" + svTime;
LogFolder= CULOGFOLDER ^ svFolderName;
I have tried almost everything I can think of:
I have looked at the setup.exe command line parameters: https://docs.revenera.com/installshield19helplib/helplibrary/IHelpSetup_EXECmdLine.htm
I have tried call the installer with:
setup.exe /z"CULOGFOLDER=C:\ProgramData\MyCompany\NewFolder"
setup.exe CULOGFOLDER=C:\ProgramData\MyCompany\NewFolder
setup.exe /f2"CULOGFOLDER=C:\ProgramData\MyCompany\NewFolder"
etc.
But nothing works...
Does anyone have an idea on how to 'change' a global variable or define from the command line?
Much appreciated,
Steve
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Okay after further looking into this, I was able to use CMDLINE...
i.e.
// Pass the CMDLINE data to the global variable LogFolder
nLength = StrLength(CMDLINE);
if (nLength > 2) then
LogFolder = CMDLINE;
StrAddLastSlash (LogFolder);
StrReplace(LogFolder,"\"","",0);
MessageBox("LogFolder is using CMDLINE, the path is: " + LogFolder, INFORMATION);
else
LogFolder = CULOGFOLDER;
MessageBox("LogFolder is using the pre determined path, the path is: " + LogFolder, INFORMATION);
endif;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Okay after further looking into this, I was able to use CMDLINE...
i.e.
// Pass the CMDLINE data to the global variable LogFolder
nLength = StrLength(CMDLINE);
if (nLength > 2) then
LogFolder = CMDLINE;
StrAddLastSlash (LogFolder);
StrReplace(LogFolder,"\"","",0);
MessageBox("LogFolder is using CMDLINE, the path is: " + LogFolder, INFORMATION);
else
LogFolder = CULOGFOLDER;
MessageBox("LogFolder is using the pre determined path, the path is: " + LogFolder, INFORMATION);
endif;