Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

what is wrong with my code for uninstalling...


1 reply to this topic

sean394

sean394
  • Members
  • 7 posts

Posted 17 June 2005 - 16:00

Hi.. i'm trying to uninstall previous version of the application and install

to a new version. This is the code i wrote.

Somehow the compile doesn't go through "LaunchAppAndWait" part,

i have no idea what i did wrong. Please help me~



#include "ifx.h"
#define EXAMPATH WINDIR ^ "C:\\Program Files\\KrCon\\KRCON2004.EXE"
#define SOURCE_VER "5.10.0000"

//---------------------------------------------------------------------------
// OnFirstUIBefore
//
// The OnFirstUIBefore event is called by the framework when the setup is
// running in first install mode. By default this event displays UI allowing
// the end user to specify installation parameters.
//---------------------------------------------------------------------------

function OnFirstUIBefore()

NUMBER nResult, nSetupType, nvSize, nUser;
STRING szTitle, szMsg, szQuestion, svName, svCompany, szFile;
STRING szLicenseFile, szDir, svVersionNumber, svVersionNumber1;
LIST list, listStartCopy;
BOOL bCustom;

begin

TARGETDIR = "C:\\Program Files\\KRCON2005";

// TO DO: if you want to enable background, window title, and caption bar title
// SetTitle( @PRODUCT_NAME, 24, WHITE );
// SetTitle( @PRODUCT_NAME, 0, BACKGROUNDCAPTION );
// Enable( FULLWINDOWMODE );
// Enable( BACKGROUND );
// SetColor(BACKGROUND,RGB (0, 128, 128));

SHELL_OBJECT_FOLDER = @PRODUCT_NAME;
szDir = INSTALLDIR;
svName = "";
svCompany = "";

//find out whether the old version is installed or not

svVersionNumber = SOURCE_VER;
VerGetFileVersion(EXAMPATH, svVersionNumber1);
nResult = VerCompare(svVersionNumber, svVersionNumber1, VERSION);

MessageBox("Uninstalling Krcon 2004", MB_OK);

if(svVersionNumber1 != "") then //it has been installed already
LaunchAppAndWait("C:\\windows\\system32\\Msiexec.exe/X{4B3903E3-3D4E-4FAA-94F9-D94D41225E92} ","",WAIT);


endif;


KathyMorey

KathyMorey
  • Full Members
  • 111 posts

Posted 20 June 2005 - 14:14

Take a closer look at the help for LaunchAppAndWait. The first parameter is the fully-qualified path to the executable and the second parameter is the command line for the executable. So your code should read:

LaunchAppAndWait("C:\\windows\\system32\\Msiexec.exe ", "/X{4B3903E3-3D4E-4FAA-94F9-D94D41225E92} ", WAIT);

Hope this helps.
Kathy Morey
Synergy Software Engineer
ProfitStars, a Jack Henry Company
kmorey@profitstars.com