changeset 3892:ac76cf27f8d5

[gaim-migrate @ 4044] A check to see if Gaim is already installed committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Sun, 03 Nov 2002 23:36:22 +0000
parents a611ec77d1d2
children b35b68d19829
files gaim-installer.nsi
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gaim-installer.nsi	Sun Nov 03 22:16:39 2002 +0000
+++ b/gaim-installer.nsi	Sun Nov 03 23:36:22 2002 +0000
@@ -7,6 +7,7 @@
 Name "Gaim 0.60 alpha 3 (Win32)"
 OutFile "gaim-0.60-alpha3.exe"
 Icon .\pixmaps\gaim-install.ico
+UninstallIcon .\pixmaps\gaim-install.ico
 
 ; Some default compiler settings (uncomment and change at will):
 ; SetCompress auto ; (can be off or force)
@@ -22,6 +23,19 @@
 DirText "Select the directory to install Gaim in:"
 
 Section "" ; (default section)
+  ; Check if previous intallation exists
+  ReadRegStr $R0 HKEY_LOCAL_MACHINE "SOFTWARE\gaim" ""
+  StrCmp $R0 "" cont_install
+    ReadRegStr $R1 HKEY_LOCAL_MACHINE "SOFTWARE\gaim" "Version"
+    StrCmp $R1 "" no_version
+      ; Gaim found, so exit Intallation
+      MessageBox MB_OK "Gaim v$R1 has already been installed. If you wish to install a new version, uninstall first." IDOK
+      Quit
+      no_version: 
+      MessageBox MB_OK "Gaim has already been installed on your machine. If you wish to install a new version, uninstall first." IDOK
+      Quit
+  cont_install:
+
   ; Install Aspell
   SetOutPath "$INSTDIR"
   File ..\win32-dev\aspell-15\bin\aspell-0.50.2.exe
@@ -33,6 +47,7 @@
 
   ; Gaim Registry Settings
   WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" "" "$INSTDIR"
+  WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" "Version" "0.60a3"
   WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gaim" "DisplayName" "Gaim (remove only)"
   WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gaim" "UninstallString" '"$INSTDIR\gaim-uninst.exe"'
   ; Set App path to include aspell dir