From 8cf465ea89ea58b5e2469f7f99df1f43ef32f792 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sun, 7 Jun 2009 20:16:04 +0000 Subject: checked in georg's patch that 'patch that checks for previous version and offers unistall choice' #2800683 svn path=/trunk/; revision=11699 --- packages/win32_inno/pd-inno.iss.in | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'packages') diff --git a/packages/win32_inno/pd-inno.iss.in b/packages/win32_inno/pd-inno.iss.in index f045955c..fb46c0d7 100755 --- a/packages/win32_inno/pd-inno.iss.in +++ b/packages/win32_inno/pd-inno.iss.in @@ -364,3 +364,26 @@ Source: build\msvcr71.dll; DestDir: {sys}; Flags: restartreplace uninsneverunins ;Source: build\portaudio\*.*; DestDir: {app}\portaudio; Flags: ignoreversion recursesubdirs ;Source: build\src\*.*; DestDir: {app}\src; Flags: ignoreversion recursesubdirs ;Source: build\tcl\*.*; DestDir: {app}\tcl; Flags: ignoreversion recursesubdirs + +[Code] +function NextButtonClick(CurPageID: Integer): Boolean; +var + ResultCode: Integer; +begin + case CurPageID of + wpReady: + begin + if(FileExists(ExpandConstant('{app}\unins000.exe')) AND FileExists(ExpandConstant('{app}\bin\pd.exe'))) then begin + if MsgBox('Found a previous Version of Pure Data at ' + ExpandConstant('{app} ') + #13#13 'Do you want to uninstall it first? (recommended)', mbConfirmation, MB_YESNO) = idYes then begin + if not Exec(ExpandConstant('{app}\unins000.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then + MsgBox('NextButtonClick:' #13#13 'The uninstall file could not be executed. ' + SysErrorMessage(ResultCode) + '.', mbError, MB_OK); + end; + end; + BringToFrontAndRestore(); + MsgBox('NextButtonClick:' #13#13 'The normal installation will now start.', mbInformation, MB_OK); + end; + end; + + Result := True; +end; + -- cgit v1.2.1