This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- how to send a return code OUT from my setup.exe
Subscribe
- 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
‎Jul 08, 2008
09:51 AM
how to send a return code OUT from my setup.exe
i need a return Code my setup.exe file.
I need to send out from my setup.rul a return code for my customer.
I need to send out from my setup.rul a return code for my customer.
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 08, 2008
04:19 PM
gerico.one wrote:
i need a return Code my setup.exe file.
I need to send out from my setup.rul a return code for my customer.
Setup.exe does not return any code (success or failure) , if you have to return a value based on what you situation then your best bet is perhaps writing a value to a temp file (which your programmer can read) or setting up an environement variable.
HTH
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 08, 2008
05:54 PM
Actually, setup.exe does have some predefined return values [please see "Setup.exe Return Values and Run-Time Errors (InstallScript Projects)" and "Setup.exe Return Values and Run-Time Errors (Basic MSI and InstallScript MSI Projects)"]; but I'm not aware of a way to specify a custom return value, so a log file of some sort might be useful.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2008
04:39 AM
i'm trying to change the variable ERRORLEVEL in the registry..i have found in the help this function..
but with a refresh (F5) in my REGISTRY EDITOR i can see this change only for few seconds..
I AM NOT SURE this is the correct way... at this moment.. i don't think so :confused:
#define WM_WININICHANGE 0x001A
#define HWND_BROADCAST 0xffff
//#define WM_WININICHANGE 0x001A
//#define HWND_BROADCAST 0xffff
prototype SetVariabile1(string);
function SetVariabile1(value)
NUMBER nResult;
STRING szKey, szEnv;
POINTER pEnv;
begin
szKey = "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
nResult = RegDBSetKeyValueEx(szKey, "ERRORLEVEL", REGDB_STRING, value, -1);
if (nResult < 0) then
//MessageBox("Failed to Set Environment Variable", WARNING);
else
//MessageBox("Successfully Set Environment Variable", INFORMATION);
// Flush the NT registry to all applications.
szEnv = "Environment";
pEnv = &szEnv;
SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
endif;
// RebootDialog("", "", SYS_BOOTMACHINE);
end;
prototype SetVariabile2(string);
function SetVariabile2(value)
NUMBER nResult;
STRING szKey, szEnv;
POINTER pEnv;
begin
szKey="Environment";
RegDBSetDefaultRoot(HKEY_CURRENT_USER);
nResult=RegDBSetKeyValueEx(szKey,"ERRORLEVEL",REGDB_STRING,value,-1);
if (nResult < 0) then
//MessageBox("Failed to Set Environment Variable",WARNING);
else
//MessageBox("Successfully Set Environment Variable",INFORMATION);
// Flush the NT registry to all applications.
szEnv = "Environment";
pEnv = &szEnv;
SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
endif;
//RebootDialog("","",SYS_BOOTMACHINE);
end;
but with a refresh (F5) in my REGISTRY EDITOR i can see this change only for few seconds..
I AM NOT SURE this is the correct way... at this moment.. i don't think so :confused:
#define WM_WININICHANGE 0x001A
#define HWND_BROADCAST 0xffff
//#define WM_WININICHANGE 0x001A
//#define HWND_BROADCAST 0xffff
prototype SetVariabile1(string);
function SetVariabile1(value)
NUMBER nResult;
STRING szKey, szEnv;
POINTER pEnv;
begin
szKey = "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
nResult = RegDBSetKeyValueEx(szKey, "ERRORLEVEL", REGDB_STRING, value, -1);
if (nResult < 0) then
//MessageBox("Failed to Set Environment Variable", WARNING);
else
//MessageBox("Successfully Set Environment Variable", INFORMATION);
// Flush the NT registry to all applications.
szEnv = "Environment";
pEnv = &szEnv;
SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
endif;
// RebootDialog("", "", SYS_BOOTMACHINE);
end;
prototype SetVariabile2(string);
function SetVariabile2(value)
NUMBER nResult;
STRING szKey, szEnv;
POINTER pEnv;
begin
szKey="Environment";
RegDBSetDefaultRoot(HKEY_CURRENT_USER);
nResult=RegDBSetKeyValueEx(szKey,"ERRORLEVEL",REGDB_STRING,value,-1);
if (nResult < 0) then
//MessageBox("Failed to Set Environment Variable",WARNING);
else
//MessageBox("Successfully Set Environment Variable",INFORMATION);
// Flush the NT registry to all applications.
szEnv = "Environment";
pEnv = &szEnv;
SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
endif;
//RebootDialog("","",SYS_BOOTMACHINE);
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2008
10:42 AM
The issue might be that setup.exe is re-setting ERRORLEVEL to its normal exit code when it exits.
(To test, perhaps put a message box after your SendMessage call, then open a new command prompt window and see if ERRORLEVEL is set? Or perhaps try a different environment variable, such as MYERRORLEVEL?)
(To test, perhaps put a message box after your SendMessage call, then open a new command prompt window and see if ERRORLEVEL is set? Or perhaps try a different environment variable, such as MYERRORLEVEL?)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2008
01:36 PM
RobertDickau wrote:
The issue might be that setup.exe is re-setting ERRORLEVEL to its normal exit code when it exits.
(To test, perhaps put a message box after your SendMessage call, then open a new command prompt window and see if ERRORLEVEL is set? Or perhaps try a different environment variable, such as MYERRORLEVEL?)
I would NOT use environment variable ERRORLEVEL as this var is being used by zillions of processes and it is likely the between you setting the value of ErrorLevel to something and your programmer reading it, some other process could reset it to something that your programmer does not want,,,,, with this being said I would create and use a some NEW environment variable (in line with what Robert suggested) and obviously record the reserved value and env var so it cant be used for any other purposes.
HTH
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 18, 2008
08:05 AM
for future readers..
this is the solution i adopted
http://kb.acresso.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=installshield12helplib-IHelpSetupEXEErrorshtm&sliceId=&docTypeID=DT_MACROVISIONHELPNET_1_1&dialogID=21637321&stateId=0%200%2021633798
doesn't work fine with installscripts project and installshield 11, good only in version 12.
this is the solution i adopted
http://kb.acresso.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=installshield12helplib-IHelpSetupEXEErrorshtm&sliceId=&docTypeID=DT_MACROVISIONHELPNET_1_1&dialogID=21637321&stateId=0%200%2021633798
doesn't work fine with installscripts project and installshield 11, good only in version 12.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)