Hi:
I assigned a Run Program to get the result into a variable, then make a compare after that. However, it issues an undefined variable error during compiling.
Run Program sc.exe create "CFS" start= auto binPath= "$TARGETDIR$\Service.exe" obj= $USERDOMAIN$\CFS password= $PWRINPUT$ (WAIT, get result into variable CFSRESULT)
if Variable CFSRESULT Equals 0
MessageBox: INFORMATION, Inside: $CFSRESULT$
end
Is there anything that I should do to fix it?
Also, the $CFSRESULT$ always returns the same value (1) no matter the password is wrong or right and the service is created. When I test the "sc.exe create" command at MS-DOS, it won't be able to create a service if the password is wrong. Anyone has any idea?
Thanks
Nhan
undefined variable for return variable in Run Program
Re: undefined variable for return variable in Run Program
Hi,
What is the error level you get when you run sc.exe in cmd? Try typing echo %errorlevel% - is it 1?
What is the error level you get when you run sc.exe in cmd? Try typing echo %errorlevel% - is it 1?
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: undefined variable for return variable in Run Program
I caught 2 cases of the return value 0 or 1057. However, the %errorlevel% always 0. Well, at least I can have 2 different values to compare now. Thus, my main question is about the variable. When I have the comparison "if Variable CFSRESULT Equals 0", I got undefined variable for CFSRESULT at compiling.
I have tried with "if Variable CFSRESULT Equals 1", same error message. Only the "MessageBox: INFORMATION, Outside: $CFSRESULT$" (without if command) is fine.
Thanks
Nhan
I have tried with "if Variable CFSRESULT Equals 1", same error message. Only the "MessageBox: INFORMATION, Outside: $CFSRESULT$" (without if command) is fine.
Thanks
Nhan
Re: undefined variable for return variable in Run Program
Hi,
Try defining the variable first - just enter at the top of your script:
Try defining the variable first - just enter at the top of your script:
Code: Select all
Set Variable CFRESULT to
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: undefined variable for return variable in Run Program
Hi,
Try defining the variable first - just enter at the top of your script:
Try defining the variable first - just enter at the top of your script:
Code: Select all
Set Variable CFRESULT to
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: undefined variable for return variable in Run Program
it works.
Thanks
Nhan
Thanks
Nhan
Re: undefined variable for return variable in Run Program
No problem!
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Who is online
Users browsing this forum: No registered users and 30 guests