# HG changeset patch # User Daniel Atallah # Date 1141424848 0 # Node ID 5d2bde0687ed227c5edf4670b474c794f4193b22 # Parent 9f95b44d561a86b966e14f96e938ceacbdeb396a [gaim-migrate @ 15764] David Everly created this patch to prevent duplication of code in the installer committer: Tailor Script diff -r 9f95b44d561a -r 5d2bde0687ed gaim-installer.nsi --- a/gaim-installer.nsi Fri Mar 03 21:49:49 2006 +0000 +++ b/gaim-installer.nsi Fri Mar 03 22:27:28 2006 +0000 @@ -906,8 +906,8 @@ Exch $1 FunctionEnd - -Function CheckUserInstallRights +!macro CheckUserInstallRightsMacro UN +Function ${UN}CheckUserInstallRights Push $0 Push $1 ClearErrors @@ -941,41 +941,9 @@ Exch Pop $0 FunctionEnd - -Function un.CheckUserInstallRights - Push $0 - Push $1 - ClearErrors - UserInfo::GetName - IfErrors Win9x - Pop $0 - UserInfo::GetAccountType - Pop $1 - - StrCmp $1 "Admin" 0 +3 - StrCpy $1 "HKLM" - Goto done - StrCmp $1 "Power" 0 +3 - StrCpy $1 "HKLM" - Goto done - StrCmp $1 "User" 0 +3 - StrCpy $1 "HKCU" - Goto done - StrCmp $1 "Guest" 0 +3 - StrCpy $1 "NONE" - Goto done - ; Unknown error - StrCpy $1 "NONE" - Goto done - - Win9x: - StrCpy $1 "HKLM" - - done: - Exch $1 - Exch - Pop $0 -FunctionEnd +!macroend +!insertmacro CheckUserInstallRightsMacro "" +!insertmacro CheckUserInstallRightsMacro "un." ; ; Usage: @@ -1230,7 +1198,9 @@ Pop $3 FunctionEnd -Function RunCheck + +!macro RunCheckMacro UN +Function ${UN}RunCheck Push $R0 System::Call 'kernel32::OpenMutex(i 2031617, b 0, t "gaim_is_running") i .R0' IntCmp $R0 0 done @@ -1239,16 +1209,9 @@ done: Pop $R0 FunctionEnd - -Function un.RunCheck - Push $R0 - System::Call 'kernel32::OpenMutex(i 2031617, b 0, t "gaim_is_running") i .R0' - IntCmp $R0 0 done - MessageBox MB_OK|MB_ICONEXCLAMATION $(GAIM_IS_RUNNING) IDOK - Abort - done: - Pop $R0 -FunctionEnd +!macroend +!insertmacro RunCheckMacro "" +!insertmacro RunCheckMacro "un." Function .onInit Push $R0