|
From: <xue...@us...> - 2003-06-16 12:38:07
|
Update of /cvsroot/popfile/windows
In directory sc8-pr-cvs1:/tmp/cvs-serv13351
Modified Files:
installer.nsi
Log Message:
Perform shutdown only if the about to be overwritten/uninstalled version is running.
Index: installer.nsi
===================================================================
RCS file: /cvsroot/popfile/windows/installer.nsi,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** installer.nsi 15 Jun 2003 11:48:52 -0000 1.67
--- installer.nsi 16 Jun 2003 12:38:03 -0000 1.68
***************
*** 534,538 ****
--- 534,559 ----
Push ${L_OLD_GUI}
Push ${L_RESULT}
+
+ Push ${CFG} ; a Global variable
+
+ ; If we are about to overwrite an existing version which is still running,
+ ; then one of the EXE files will be 'locked' which means we have to shutdown POPFile
+ IfFileExists "$INSTDIR\wperl.exe" 0 other_perl
+ SetFileAttributes "$INSTDIR\wperl.exe" NORMAL
+ ClearErrors
+ FileOpen ${CFG} "$INSTDIR\wperl.exe" a
+ FileClose ${CFG}
+ IfErrors attempt_shutdown
+
+ other_perl:
+ IfFileExists "$INSTDIR\perl.exe" 0 exit_now
+ SetFileAttributes "$INSTDIR\perl.exe" NORMAL
+ ClearErrors
+ FileOpen ${CFG} "$INSTDIR\perl.exe" a
+ FileClose ${CFG}
+ IfErrors 0 exit_now
+
+ attempt_shutdown:
!insertmacro MUI_INSTALLOPTIONS_READ "${L_NEW_GUI}" "ioA.ini" "UI Port" "NewStyle"
!insertmacro MUI_INSTALLOPTIONS_READ "${L_OLD_GUI}" "ioA.ini" "UI Port" "OldStyle"
***************
*** 559,562 ****
--- 580,585 ----
exit_now:
+ Pop ${CFG} ; a Global variable
+
Pop ${L_RESULT}
Pop ${L_OLD_GUI}
***************
*** 1532,1539 ****
skip_confirmation:
! ; Shutdown POPFile before uninstalling it
ClearErrors
FileOpen ${CFG} $INSTDIR\popfile.cfg r
--- 1555,1578 ----
skip_confirmation:
! ; If the POPFile we are about to uninstall is still running,
! ; then one of the EXE files will be 'locked'
+ IfFileExists "$INSTDIR\wperl.exe" 0 other_perl
+ SetFileAttributes "$INSTDIR\wperl.exe" NORMAL
+ ClearErrors
+ FileOpen ${CFG} "$INSTDIR\wperl.exe" a
+ FileClose ${CFG}
+ IfErrors attempt_shutdown
+
+ other_perl:
+ IfFileExists "$INSTDIR\perl.exe" 0 skip_shutdown
+ SetFileAttributes "$INSTDIR\perl.exe" NORMAL
ClearErrors
+ FileOpen ${CFG} "$INSTDIR\perl.exe" a
+ FileClose ${CFG}
+ IfErrors 0 skip_shutdown
+ attempt_shutdown:
+ ClearErrors
FileOpen ${CFG} $INSTDIR\popfile.cfg r
|