InstallScript: ChangeDirectory() call fails only in SILENTMODE

1

I have the following test InstallScript InstallShield code, which executes correctly in the normal interactive mode, but crashes setup.exe /s (silent) mode on calls to ChangeDirectory that involve any sort of actual depth of directories.

//Note: "C:" ^ "temp" resolves to "C:\temp", but it never successfully 
//executes when run silent mode. It works fine in interactive mode, however.
ChangeDirectory("C:" ^ "temp");
//No subsequent code gets executed at this point in silent mode 

I'm running this on a Windows 2008 x64 Server in a command window with Administrator privileges. The c:\temp directory exists, and EVERYONE has been granted full control rights to it.

The exit code is -2147213312, which is 0x80042000 in the error guide corresponding to

The installation exited with the abort keyword because the end user canceled the installation.

What could possibly be going on here? I've tried using the try/catch syntax to examine the error, but the catch block never executes in this case, seemingly asserting that there's no error but instead an abort called?

installshield
installscript
asked on Stack Overflow Oct 23, 2012 by Mike Atlas • edited Oct 23, 2012 by Mike Atlas

2 Answers

1

The Installscript Engine does a lot of stuff behind the scene. It keeps changing the working directory. Thus, it is not very reliable to use ChangeDirectory(). It is surely better to use FULL PATH to all executables and other files. LaunchAppAndWait() too has this trouble. So full path needs to be used without fail.

Further, the Installshield help for ChangeDirectory() clearly mentions the following:

When you are specifying a file in your script, always specify the full path (using the appropriate InstallShield system variable, for example, SRCDIR) rather than depend on the current folder having the appropriate value. The script internally executes code that can change the current folder, so its value may not be what you expect.

The thing is, results are not reliable. They may work or may not.

answered on Stack Overflow Mar 18, 2013 by msiyer • edited Mar 18, 2013 by msiyer
0

We get this errorcode when our recorded .iss file is missing an entry in the .iss response file.

See Creating the Response File for more Details.

Logging an installscript setup didn't give us much information, so we wrote some functions to write to a custom logfile which helped us a lot.

answered on Stack Overflow Oct 26, 2012 by haide

User contributions licensed under CC BY-SA 3.0