I am using InstallAware 18 (Build 10.23.13) and having the following problem.
I'm trying to add a directory to the PATH environment variable when running a program using "Run Program As". However, on my Windows 7 (64bit) machine I'm testing on, the application never starts. On a Windows XP machine I'm testing on, the application starts, but demonstrates incorrect behavior.
After much testing and trawling through these forums, I've got no closer to an answer, the closest being Run Program As - Environment parameter questions.
I've cut this down to the simplest script that I can (this is the whole script):
Code: Select all
Set Variable LAST_ERROR to
Set Variable CMDRESULT to
Get All Environment Variables into Variable SYSENV
Get Folder Location System->System Directory into WINSYSDIR
Run Program $WINSYSDIR$\CMD.exe /k set (WAIT, get result into variable CMDRESULT)
Call DLL Function kernel32.dll->GetLastError (get result into variable LAST_ERROR)
MessageBox: Finished!, CMDRESULT: $CMDRESULT$$NEWLINE$$NEWLINE$LAST_ERROR: $LAST_ERROR$$NEWLINE$
Code: Select all
~InstallAware Clipboard Data~
~MessageBox~
~{4390FA4C-37B9-44F8-BA78-6B0AE95B735E}~
~Finished!~
~CMDRESULT: $CMDRESULT$$NEWLINE$$NEWLINE$LAST_ERROR: $LAST_ERROR$$NEWLINE$~
~0~
~1~
~~
~Call DLL Function~
~{F49C6CA5-26C1-4D7A-841D-EA2F68C7EFBA}~
~kernel32.dll,GetLastError,"double word",LAST_ERROR,$~
~mIDEFunc.dll\mEXEFunc.dll~
~Run Program As~
~{B3384F1D-3869-46F9-B151-279C268ED5A6}~
~$WINSYSDIR$\CMD.exe~
~~
~/k set~
~0~
~~
~~
~~
~CMDRESULT~
~TRUE~
~$SYSENV$~
~Get Folder Location~
~{5C7ACF51-14A4-40D4-8CFD-C5FE5E91C795}~
~WINSYSDIR~
~23~
~FALSE~
~Get Environment~
~{0831297B-9D81-4EF4-B8EC-F726F17ADA44}~
~~
~SYSENV~
~Set Variable~
~{18962834-63D7-4021-9177-E5D76FC5C091}~
~CMDRESULT$MYAH$MYAH$FALSE~
~~
~Set Variable~
~{CD6A70E6-1F98-49C2-AFA2-5F5F1EB3008C}~
~LAST_ERROR$MYAH$MYAH$FALSE~
~~
When run on Windows XP, the CMD window displayed shows:
Code: Select all
A
L
L
U
S
E
R
S
P
R
O
F
I
L
E
C
:
D
o
c
u
m
e
n
t
s
a
n
d
S
e
t
t
i
n
g
s
A
l
l
U
s
e
r
s
COMSPEC=C:\WINDOWS\system32\CMD.exe
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS
PROMPT=$P$G
And the Message Box shows:
CMDRESULT: -1073741510
LAST_ERROR: 0
On Windows 7, there is no CMD window, and the Message Box shows:
CMDRESULT: -11
LAST_ERROR: 0
If i cut the Environment variable right back to a single value:
Code: Select all
~InstallAware Clipboard Data~
~Run Program As~
~{B3384F1D-3869-46F9-B151-279C268ED5A6}~
~$WINSYSDIR$\CMD.exe~
~~
~/k set~
~0~
~~
~~
~~
~CMDRESULT~
~TRUE~
~ENV=VALUE~
Still nothing on Windows 7, while Windows XP shows:
Code: Select all
E
N
V
V
A
L
U
E
COMSPEC=C:\WINDOWS\system32\CMD.exe
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS
PROMPT=$P$G
Do you have any idea why the application won't run on Windows 7? Is it something to do with the Unicode values IA is using to set the Environment Variables?
Chris
EDIT: When using a blank value for "Environtment", the CMD window on both Windows 7 and XP appears correctly and show the same values in the Message box:
CMDRESULT: -1073741510
LAST_ERROR: 0