From: <jgr...@us...> - 2003-02-26 04:08:44
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1:/tmp/cvs-serv13576 Modified Files: installer.nsi ioB.ini Log Message: The installer now restores the values of registry keys that it changes by storing the values in the file popfile.reg and then reading it when uninstalling; changed the text associated with Outlook Express because I have confirmed that the same code will reconfigure Internet email accounts configured in Outlook as well; made this the RC1 installer Index: installer.nsi =================================================================== RCS file: /cvsroot/popfile/windows/installer.nsi,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** installer.nsi 26 Feb 2003 02:40:02 -0000 1.27 --- installer.nsi 26 Feb 2003 04:08:41 -0000 1.28 *************** *** 50,56 **** !insertmacro MUI_PAGECOMMAND_COMPONENTS !insertmacro MUI_PAGECOMMAND_DIRECTORY ! Page custom SetOptionsPage "Options" !insertmacro MUI_PAGECOMMAND_INSTFILES ! Page custom SetOutlookExpressPage "Configure Outlook Express" !insertmacro MUI_PAGECOMMAND_FINISH --- 50,56 ---- !insertmacro MUI_PAGECOMMAND_COMPONENTS !insertmacro MUI_PAGECOMMAND_DIRECTORY ! Page custom SetOptionsPage ": Options" !insertmacro MUI_PAGECOMMAND_INSTFILES ! Page custom SetOutlookOrOutlookExpressPage ": Configure Outlook or Outlook Express" !insertmacro MUI_PAGECOMMAND_FINISH *************** *** 261,269 **** WriteINIStr "$SMPROGRAMS\POPFile\Manual.url" \ "InternetShortcut" "URL" "file://$INSTDIR/manual/en/manual.html" SetOutPath $SMPROGRAMS\POPFile\Support WriteINIStr "$SMPROGRAMS\POPFile\Support\POPFile Home Page.url" \ "InternetShortcut" "URL" "http://popfile.sourceforge.net/" - WriteINIStr "$SMPROGRAMS\POPFile\Support\POPFile Manual.url" \ - "InternetShortcut" "URL" "http://popfile.sourceforge.net/manual.html" StrCmp ${STARTUP} "1" 0 skip_autostart_set --- 261,269 ---- WriteINIStr "$SMPROGRAMS\POPFile\Manual.url" \ "InternetShortcut" "URL" "file://$INSTDIR/manual/en/manual.html" + WriteINIStr "$SMPROGRAMS\POPFile\FAQ.url" \ + "InternetShortcut" "URL" "http://sourceforge.net/docman/display_doc.php?docid=14421&group_id=63137" SetOutPath $SMPROGRAMS\POPFile\Support WriteINIStr "$SMPROGRAMS\POPFile\Support\POPFile Home Page.url" \ "InternetShortcut" "URL" "http://popfile.sourceforge.net/" StrCmp ${STARTUP} "1" 0 skip_autostart_set *************** *** 323,329 **** FunctionEnd ! ; This function is used to reconfigure Outlook Express accounts ! Function SetOutlookExpressPage ; In Outlook Express (v5.0 or later) the email account data may appear in --- 323,329 ---- FunctionEnd ! ; This function is used to reconfigure Outlook or Outlook Express accounts ! Function SetOutlookOrOutlookExpressPage ; In Outlook Express (v5.0 or later) the email account data may appear in *************** *** 398,402 **** StrCmp $R6 "127.0.0.1" next_acct_increment ! !insertmacro MUI_HEADER_TEXT "Reconfigure Outlook Express" "POPFile can reconfigure Outlook Express for you" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioB.ini" "Field 2" "State" "0" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioB.ini" "Field 8" "Text" $R6 --- 398,402 ---- StrCmp $R6 "127.0.0.1" next_acct_increment ! !insertmacro MUI_HEADER_TEXT "Reconfigure Outlook or Outlook Express" "POPFile can reconfigure Outlook or Outlook Express for you" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioB.ini" "Field 2" "State" "0" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioB.ini" "Field 8" "Text" $R6 *************** *** 421,424 **** --- 421,443 ---- ReadRegStr $R6 HKCU $R5 "POP3 User Name" ReadRegStr $R7 HKCU $R5 "POP3 Server" + + ; To be able to restore the registry to previous settings when we uninstall we + ; write a special file called popfile.reg containing the registry settings + ; prior to modification in the form of lines consisting of + ; + ; the\key + ; thesubkey + ; the\value + + FileOpen ${CFG} $INSTDIR\popfile.reg a + FileSeek ${CFG} 0 END + FileWrite ${CFG} "$R5$\n" + FileWrite ${CFG} "POP3 User Name$\n" + FileWrite ${CFG} "$R6$\n" + FileWrite ${CFG} "$R5$\n" + FileWrite ${CFG} "POP3 Server$\n" + FileWrite ${CFG} "$R7$\n" + FileClose ${CFG} + WriteRegStr HKCU $R5 "POP3 User Name" "$R7:$R6" WriteRegStr HKCU $R5 "POP3 Server" "127.0.0.1" *************** *** 431,434 **** --- 450,476 ---- FunctionEnd + ; TrimNewlines + ; input, top of stack (e.g. whatever$\r$\n) + ; output, top of stack (replaces, with e.g. whatever) + ; modifies no other variables. + + Function un.TrimNewlines + Exch $R0 + Push $R1 + Push $R2 + StrCpy $R1 0 + loop: + IntOp $R1 $R1 - 1 + StrCpy $R2 $R0 1 $R1 + StrCmp $R2 "$\r" loop + StrCmp $R2 "$\n" loop + IntOp $R1 $R1 + 1 + + StrCpy $R0 $R0 $R1 + Pop $R2 + Pop $R1 + Exch $R0 + FunctionEnd + ;-------------------------------- ;Uninstaller Section *************** *** 456,459 **** --- 498,528 ---- Delete $INSTDIR\*.dll Delete $INSTDIR\popfile.cfg + + ; Read the registry settings found in popfile.reg and restore them + ; it there are any. All are assumed to be in HKCU + FileOpen ${CFG} $INSTDIR\popfile.reg r + IfErrors skip_registry_restore + restore_loop: + FileRead ${CFG} $R5 + Push $R5 + Call un.TrimNewlines + Pop $R5 + IfErrors skip_registry_restore + FileRead ${CFG} $R6 + Push $R6 + Call un.TrimNewlines + Pop $R6 + IfErrors skip_registry_restore + FileRead ${CFG} $R7 + Push $R7 + Call un.TrimNewlines + Pop $R7 + IfErrors skip_registry_restore + WriteRegStr HKCU $R5 $R6 $R7 + goto restore_loop + + skip_registry_restore: + FileClose ${CFG} + Delete $INSTDIR\popfile.reg Delete $INSTDIR\Proxy\*.pm Index: ioB.ini =================================================================== RCS file: /cvsroot/popfile/windows/ioB.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ioB.ini 25 Feb 2003 01:48:51 -0000 1.2 --- ioB.ini 26 Feb 2003 04:08:41 -0000 1.3 *************** *** 5,9 **** [Field 1] Type=label ! Text=POPFile has detected the following Outlook Express email account and can automatically configure it to work with POPFile Left=0 Right=-1 --- 5,9 ---- [Field 1] Type=label ! Text=POPFile has detected the following Outlook or Outlook Express email account and can automatically configure it to work with POPFile Left=0 Right=-1 *************** *** 45,49 **** [Field 6] Type=label ! Text=If you uninstall POPFile the original settings will be restored (NOT YET IMPLEMENTED) Left=0 Right=-1 --- 45,49 ---- [Field 6] Type=label ! Text=If you uninstall POPFile the original settings will be restored Left=0 Right=-1 |