changeset 9902:b0f2c9c0d23b

[gaim-migrate @ 10794] Save the "run on startup?" Windows pref upon Gaim upgrades committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 28 Aug 2004 15:11:22 +0000
parents 7bb46db14be0
children 9f4459a32b8f
files gaim-installer.nsi
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gaim-installer.nsi	Sat Aug 28 14:29:25 2004 +0000
+++ b/gaim-installer.nsi	Sat Aug 28 15:11:22 2004 +0000
@@ -11,6 +11,7 @@
 Var GTK_THEME_SEL
 Var LANG_IS_SET
 Var ISSILENT
+Var STARTUP_RUN_KEY
 
 ;--------------------------------
 ;Configuration
@@ -200,6 +201,18 @@
   Call CheckUserInstallRights
   Pop $R0
 
+  ;If gaim is currently set to run on startup,
+  ;  save the section of the Registry where the setting is before uninstalling,
+  ;  so we can put it back after installing the new version
+  ClearErrors
+  ReadRegStr $STARTUP_RUN_KEY HKCU "${GAIM_STARTUP_RUN_KEY}" "Gaim"
+  IfErrors +3
+  StrCpy $STARTUP_RUN_KEY "HKCU"
+  Goto +4
+  ReadRegStr $STARTUP_RUN_KEY HKLM "${GAIM_STARTUP_RUN_KEY}" "Gaim"
+  IfErrors +2
+  StrCpy $STARTUP_RUN_KEY "HKLM"
+
   StrCmp $R0 "HKLM" gaim_hklm
   StrCmp $R0 "HKCU" gaim_hkcu done
 
@@ -446,6 +459,12 @@
     WriteUninstaller "$INSTDIR\${GAIM_UNINST_EXE}"
     SetOverwrite off
 
+    ; If we previously had gaim setup to run on startup, make it do so again
+    StrCmp $STARTUP_RUN_KEY "HKCU" +1 +2
+    WriteRegStr HKCU "${GAIM_STARTUP_RUN_KEY}" "Gaim" "$INSTDIR\gaim.exe"
+    StrCmp $STARTUP_RUN_KEY "HKLM" +1 +2
+    WriteRegStr HKLM "${GAIM_STARTUP_RUN_KEY}" "Gaim" "$INSTDIR\gaim.exe"
+
   done:
 SectionEnd ; end of default Gaim section