cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
scmt_genetec
Level 2

passing data to a InstallScript Project

Jump to solution

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

0 Kudos
(1) Solution
scmt_genetec
Level 2

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;

View solution in original post

0 Kudos
(1) Reply
scmt_genetec
Level 2

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;

0 Kudos