1 ; Installer script for win32 Gaim
2 ; Herman Bloggs <hermanator12002@yahoo.com>
4 ; NOTE: this .NSI script is designed for NSIS v2.0b0+
6 Name "Gaim 0.60 alpha 3 (Win32)"
7 OutFile "gaim-0.60-alpha3.exe"
8 Icon .\pixmaps\gaim
-install
.ico
9 UninstallIcon .\pixmaps\gaim
-install
.ico
11 ; Some default compiler settings (uncomment and change at will):
12 ; SetCompress auto ; (can be off or force)
13 ; SetDatablockOptimize on ; (can be off)
14 ; CRCCheck on ; (can be off)
15 ; AutoCloseWindow false ; (can be true for the window go away automatically at end)
16 ; ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
17 ; SetDateSave off ; (can be on to have files restored to their orginal date)
19 InstallDir "$PROGRAMFILES\Gaim"
20 InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" ""
21 DirShow show
; (make this hide to not let the user change it)
22 DirText "Select the directory to install Gaim in:"
24 Section "" ; (default section)
25 ; Check if previous intallation exists
26 ReadRegStr $R0 HKEY_LOCAL_MACHINE "SOFTWARE\gaim" ""
27 StrCmp $R0 "" cont_install
28 ReadRegStr $R1 HKEY_LOCAL_MACHINE "SOFTWARE\gaim" "Version"
29 StrCmp $R1 "" no_version
30 ; Gaim found, so exit Intallation
31 MessageBox MB_OK "Gaim (v$R1) already exists on this machine. Uninstall first then try again." IDOK
34 MessageBox MB_OK "Gaim already exists on this machine. Uninstall first then try again." IDOK
39 File ..\win32
-dev\aspell
-15\bin\aspell
-0.50.2.exe
40 ExecWait '"$INSTDIR\aspell-0.50.2.exe" /S' $R0
41 ; cleanup aspell installer file
42 Delete "$INSTDIR\aspell-0.50.2.exe"
43 ; Check if aspell installer completed ok
44 StrCmp $R0 "0" have_aspell
45 ; Aspell exited uncleanly so we will exit uncleanly too.
51 File /r
.\win32
-install
-dir\
*.*
53 ; Gaim Registry Settings
54 ; Read in Aspell install path
55 ReadRegStr $R0 HKEY_LOCAL_MACHINE "Software\Aspell" ""
56 WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" "" "$INSTDIR"
57 WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" "Version" "0.60a3"
58 ; Keep track of aspell install path, for when we uninstall
59 WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" "AspellPath" $R0
60 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gaim" "DisplayName" "Gaim (remove only)"
61 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gaim" "UninstallString" '"$INSTDIR\gaim-uninst.exe"'
62 ; Set App path to include aspell dir (so Gaim can find aspell dlls)
63 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\gaim.exe" "" "$INSTDIR\gaim.exe"
64 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\gaim.exe" "Path" $R0
65 ; Increase refrence count for aspell dlls
66 Push "$R0\aspell-15.dll"
68 Push "$R0\aspell-common-0-50-2.dll"
70 Push "$R0\pspell-15.dll"
73 ; Set Start Menu icons
74 SetOutPath "$SMPROGRAMS\Gaim"
75 CreateShortCut "$SMPROGRAMS\Gaim\Gaim.lnk" \
77 CreateShortCut "$SMPROGRAMS\Gaim\Unistall.lnk" \
78 "$INSTDIR\gaim-uninst.exe"
80 ; write out uninstaller
81 WriteUninstaller "$INSTDIR\gaim-uninst.exe"
82 SectionEnd ; end of default section
84 ; begin uninstall settings/section
85 UninstallText "This will uninstall Gaim from your system"
90 RMDir /r
"$SMPROGRAMS\Gaim"
92 ; Read in Aspell install path
93 ReadRegStr $R0 HKEY_LOCAL_MACHINE "Software\Gaim" "AspellPath"
95 ; Delete Gaim Registry Settings
96 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Gaim"
97 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Gaim"
98 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\gaim.exe"
100 ; Decrease refrence count for Aspell dlls
101 Push "$R0\aspell-15.dll"
102 Call un
.RemoveSharedDLL
103 Push "$R0\aspell-common-0-50-2.dll"
104 Call un
.RemoveSharedDLL
105 Push "$R0\pspell-15.dll"
106 Call un
.RemoveSharedDLL
108 ; Delete aspell dir if its empty
110 SectionEnd ; end of uninstall section
118 ; Increments a shared DLLs reference count.
119 ; Use by passing one item on the stack (the full path of the DLL).
122 ; Push $SYSDIR\myDll.dll
126 Function AddSharedDLL
129 ReadRegDword
$R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs
$R1
131 WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs
$R1 $R0
138 ; Decrements a shared DLLs reference count, and removes if necessary.
139 ; Use by passing one item on the stack (the full path of the DLL).
140 ; Note: for use in the main installer (not the uninstaller), rename the
141 ; function to RemoveSharedDLL.
144 ; Push $SYSDIR\myDll.dll
145 ; Call un.RemoveShareDLL
148 Function un
.RemoveSharedDLL
151 ReadRegDword
$R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs
$R1
154 IntCmp $R0 0 rk rk uk
156 DeleteRegValue HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs
$R1
159 WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs
$R1 $R0