cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jjb8297
Level 6

ISDEV - Fatal Error -5037

Greetings, :confused:

Tis funny, no matter what programming language you use, or whether you are doing installs like I am doing right now. You always get an error message that really doesn't have a lot of information to go with it, or what you find is just cryptic as the error message itself.

Guess this one is no different. What I tried to do is change the licence agreement dialog to check to see if there was a previous version of the software before it moved onto the licence page.

I added a condition to the next button and then this cropped up, I removed the said change and still this is cropping up. So it may not have been my change at all.

What I was trying to do is detect if a previous version of the software existed on the users machine, if it did then I would attempt to uninstall it from their machine.

I would call this function FindPreviousVersion(HWND) from a custom action and then depending on whether or not it removed would determine if it moved on or not to the next dialog.

Any help would be appreciated. Thanks.

This is the code I was trying to use

//////////////////////////////////////////////////////////////////////////////
//
// Function : FindPreviousVersion(HWND)
//
// Purpose : Checks to see if the previous version of the application is already
// installed on the users machine.
// Author :
// Date : 11/26/2007 (Created)
// Notes :
///////////////////////////////////////////////////////////////////////////////
function FindPreviousVersion(hMSI)
STRING szString, szMsg, svResults, svString, szDir;
NUMBER nResult, nReturn;
BOOL bDir, bSearch;
begin

//Set the search path
szString = "C:\\Program Files\\JD Maker Exp;C:\\Program Files\\JD Maker JD;C:\\Program Files\\JD Maker JD - Mag;";
//Place the search path into the path buffer
if (PathSet(szString) < 0) then
//Report error
MessageBox ("PathSet failed.", SEVERE);
abort;
else
szMsg = "PathSEt set the path buffer to: %s";
SprintfBox (INFORMATION,"PathSet ID Maker",szMsg,szString);
endif;
//Set default value for nReturn to 0 for nothing found
nReturn = 0;
//Set the path find variables
szDir = "ID Maker Express";
//Search the path buff for paths that include ID Maker folder.
nResult = PathFind(szDir,svResults,PARTIAL,RESTART);
//Error check on PathFind
if (nResult = 0) then
nReturn = 1; //Express
else
szDir = "ID Maker Pro - Mag";
nResult = PathFind(szDir,svResults,PARTIAL,CONTINUE);
if (nResult = 0) then
nReturn = 3; //Pro-Mag
else
szDir = "ID Maker Pro - Mag";
nResult = PathFind(szDir,svResults,PARTIAL,CONTINUE);
if (nResult = 0) then
nReturn = 2; //Pro
endif;
endif;
endif;

if (nReturn > 0) then
MessageBox("Uninstalling previous version",INFORMATION);
//Some stuff still needed here
nReturn = LaunchUninstallPreviousVersion(hMSI,nReturn);
switch(nReturn)
case 0: MsiSetProperty(hMSI, "PREVIOUSVERSION", "1");
default: //Issue uninstalling software
MessageBox("Could not remove the previous version of the software",SEVERE);
abort;
endswitch;
else
MessageBox("No previous version found",INFORMATION);
MsiSetProperty(hMSI, "PREVIOUSVERSION", "1");
endif;

end;

//////////////////////////////////////////////////////////////////////////////
//
// Function : LaunchUninstallPreviousVersion(HWND)
//
// Purpose : Uninstall the previous version of the application
// Author :
// Date : 11/26/2007 (Created)
// Notes :
///////////////////////////////////////////////////////////////////////////////
function LaunchUninstallPreviousVersion(hMSI, nVersion)
STRING szProgram, szCmdLine, szMsg;
BOOL bLaunchAndWait, bExit;
NUMBER nWait;
begin

//Set default values
bLaunchAndWait = TRUE;
nWait = WAIT;

switch(nVersion)
case 1: //Express
szProgram = PROGRAMFILES^"JD Exp\unwise.exe";
case 2: //Pro
szProgram = PROGRAMFILES^"JD Maker JD\unwise.exe";
case 3: //Pro-Mag
szProgram = PROGRAMFILES^"JD Maker JD-Mag\unwise.exe";
endswitch;

//Run the installation in a normal window
Enable (BACKGROUND);
Enable (DEFWINDOWMODE);

//Disable the back button in the installation dialogs
Disable (BACKBUTTON);

//Launch uninstall
if (LaunchAppAndWait(szProgram,"",nWait) < 0) then
MessageBox ("Unable to uninstall previous version " + szProgram + ". Set up will now exit.",SEVERE);
abort;
endif;
end;
Labels (1)
0 Kudos
(1) Reply
jedimaster_mark
Level 7

What's the error message?

And you mention a custom action, which is used in MSIs, but this is InstallScript code. So are you running InstallScript CAs from an MSI?
0 Kudos