comparison pidgin/win32/nsis/pidgin-installer.nsi @ 21852:c8e37362179a

Allow the user to Retry if Pidgin is running when they start the installer. Fixes #4355
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 18 Dec 2007 02:26:44 +0000
parents 476586ae4aff
children a464f202e6c4
comparison
equal deleted inserted replaced
21851:54e1f0e024d2 21852:c8e37362179a
1152 1152
1153 1153
1154 !macro RunCheckMacro UN 1154 !macro RunCheckMacro UN
1155 Function ${UN}RunCheck 1155 Function ${UN}RunCheck
1156 Push $R0 1156 Push $R0
1157 System::Call 'kernel32::OpenMutex(i 2031617, b 0, t "pidgin_is_running") i .R0' 1157 Push $R1
1158 IntCmp $R0 0 done 1158
1159 MessageBox MB_OK|MB_ICONEXCLAMATION $(PIDGIN_IS_RUNNING) /SD IDOK 1159 IntOp $R1 0 + 0
1160 retry_runcheck:
1161 ; Close the Handle (needed if we're retrying)
1162 IntCmp $R1 0 +2
1163 System::Call 'kernel32::CloseHandle(i $R1) i .R1'
1164 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "pidgin_is_running") i .R1 ?e'
1165 Pop $R0
1166 IntCmp $R0 0 +3 ;This could check for ERROR_ALREADY_EXISTS(183), but lets just assume
1167 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(PIDGIN_IS_RUNNING) /SD IDCANCEL IDRETRY retry_runcheck
1160 Abort 1168 Abort
1169
1161 done: 1170 done:
1171 Pop $R1
1162 Pop $R0 1172 Pop $R0
1163 FunctionEnd 1173 FunctionEnd
1164 !macroend 1174 !macroend
1165 !insertmacro RunCheckMacro "" 1175 !insertmacro RunCheckMacro ""
1166 !insertmacro RunCheckMacro "un." 1176 !insertmacro RunCheckMacro "un."
1167 1177
1168 Function .onInit 1178 Function .onInit
1169 Push $R0 1179 Push $R0
1170 Push $R1 1180 Push $R1
1171 Push $R2 1181 Push $R2
1172 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "pidgin_installer_running") i .r1 ?e' 1182
1173 Pop $R0 1183 IntOp $R1 0 + 0
1174 StrCmp $R0 0 +3 1184 retry_runcheck:
1175 MessageBox MB_OK|MB_ICONEXCLAMATION $(INSTALLER_IS_RUNNING) /SD IDOK 1185 ; Close the Handle (needed if we're retrying)
1186 IntCmp $R1 0 +2
1187 System::Call 'kernel32::CloseHandle(i $R1) i .R1'
1188 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "pidgin_installer_running") i .R1 ?e'
1189 Pop $R0
1190 IntCmp $R0 0 +3 ;This could check for ERROR_ALREADY_EXISTS(183), but lets just assume
1191 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(INSTALLER_IS_RUNNING) /SD IDCANCEL IDRETRY retry_runcheck
1176 Abort 1192 Abort
1177 Call RunCheck 1193 Call RunCheck
1178 StrCpy $name "Pidgin ${PIDGIN_VERSION}" 1194 StrCpy $name "Pidgin ${PIDGIN_VERSION}"
1179 StrCpy $SPELLCHECK_SEL "" 1195 StrCpy $SPELLCHECK_SEL ""
1180 1196