;Copyright 2004-2007 John T. Haller of PortableApps.com ;Calendar and chrome.rdf procedures Copyright 2004 Gerard Balagué ;Website: http://PortableApps.com/ThunderbirdPortable ;This software is OSI Certified Open Source Software. ;OSI Certified is a certification mark of the Open Source Initiative. ;This program is free software; you can redistribute it and/or ;modify it under the terms of the GNU General Public License ;as published by the Free Software Foundation; either version 2 ;of the License, or (at your option) any later version. ;This program is distributed in the hope that it will be useful, ;but WITHOUT ANY WARRANTY; without even the implied warranty of ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;GNU General Public License for more details. ;You should have received a copy of the GNU General Public License ;along with this program; if not, write to the Free Software ;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. /* ------------------------------------------------------- Portable Thunderbird FR ------------------------------------------------------- Version : 2.0.0.6 Modified by pyg for Framakey.org L'ensemble du code ci-dessous (à quelques lignes prêt) est repris du lanceur Thunderbird Portable de John T Haller. Seules les modifications de splashscreens et de noms ont été effectué. PortableThunderbird est donc une version française de ThunderbirdPortable diffusé via le portail http://www.framakey.org/ All of the code below (except a few lines) belongs to John T. Haller's great work for his Thunderbird Portable. Only splashscreens and localizations strings have been changed. You may consider PortableThunderbird as french package of Thunderbird Portable. */ !define LONGNAME "PortableThunderbird" !define FULLNAME "Thunderbird Portable" !define NAME "PortableThunderbird" !define APP "Thunderbird" !define VER "1.3.8.1" !define WEBSITE "Framakey.org/" !define DEFAULTEXE "Thunderbird.exe" !define DEFAULTAPPDIR "Thunderbird" !define DEFAULTGPGPATH "gpg" !define DEFAULTGPGHOME "gpg" ;=== Program Details Name "${LONGNAME}" OutFile "${NAME}.exe" Caption "${LONGNAME} | PortableApps.com" VIProductVersion "${VER}" VIAddVersionKey ProductName "${LONGNAME}" VIAddVersionKey Comments "Permet à ${APP} d'être executé depuis un media amovible. Pour plus de détails, voir ${WEBSITE}" VIAddVersionKey CompanyName "Framakey.org (code from PortableApps.com)" VIAddVersionKey LegalCopyright "John T. Haller, portions Gerard Balagué, Pierre-Yves Gosset" VIAddVersionKey FileDescription "${LONGNAME}" VIAddVersionKey FileVersion "${VER}" VIAddVersionKey ProductVersion "${VER}" VIAddVersionKey InternalName "${LONGNAME}" VIAddVersionKey LegalTrademarks "Thunderbird is a trademark of The Mozilla Foundation. PortableApps.com is a trademark of Rare Ideas, LLC." VIAddVersionKey OriginalFilename "${NAME}.exe" ;VIAddVersionKey PrivateBuild "" ;VIAddVersionKey SpecialBuild "" ;=== Runtime Switches CRCCheck On ;WindowIcon Off ;SilentInstall Silent AutoCloseWindow True RequestExecutionLevel user ;=== Include !include "Registry.nsh" !include "Attrib.nsh" !include "GetParameters.nsh" !include "MUI.nsh" ;=== Program Icon Icon "${NAME}.ico" ;=== Icon & Stye === !define MUI_ICON "${NAME}.ico" BrandingText "PortableApps.com - Your Digital Life, Anywhere™" MiscButtonText "" "" "" "Continue" InstallButtonText "Continue" ;=== Pages !define MUI_LICENSEPAGE_RADIOBUTTONS !insertmacro MUI_PAGE_LICENSE "EULA.txt" !insertmacro MUI_PAGE_INSTFILES ;=== Languages !insertmacro MUI_LANGUAGE "English" Var PROGRAMDIRECTORY Var PROFILEDIRECTORY Var PLUGINSDIRECTORY Var SETTINGSDIRECTORY Var GPGPATHDIRECTORY Var GPGHOMEDIRECTORY Var ADDITIONALPARAMETERS Var ALLOWMULTIPLEINSTANCES Var SKIPCHROMEFIX Var SKIPCOMPREGFIX Var EXECSTRING Var WAITFORPROGRAM Var PROGRAMEXECUTABLE Var INIPATH Var ISFILELINE Var DISABLESPLASHSCREEN Var DISABLEINTELLIGENTSTART Var ISDEFAULTDIRECTORY Var RUNLOCALLY Var SECONDARYLAUNCH Var USERTYPE Var LASTPROFILEDIRECTORY Var SHOWLICENSE Function .onInit Call GetParameters Pop $0 StrCmp "$0" "SHOWLICENSE" ShowLicense LicenseDone ShowLicense: StrCpy $SHOWLICENSE "true" Goto onInitDone LicenseDone: SetSilent silent Goto onInitDone onInitDone: FunctionEnd Section "Main" ;=== Find the INI file, if there is one IfFileExists "$EXEDIR\${NAME}.ini" "" NoINI StrCpy "$INIPATH" "$EXEDIR\" Goto ReadINI ReadINI: ;=== Read the parameters from the INI file ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "${APP}Directory" StrCpy "$PROGRAMDIRECTORY" "$EXEDIR\$0" ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "ProfileDirectory" StrCpy "$PROFILEDIRECTORY" "$EXEDIR\$0" ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "SettingsDirectory" StrCpy "$SETTINGSDIRECTORY" "$EXEDIR\$0" ;=== Check that the above required parameters are present IfErrors NoINI ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "PluginsDirectory" StrCpy "$PLUGINSDIRECTORY" "$EXEDIR\$0" ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "GPGPathDirectory" StrCpy "$GPGPATHDIRECTORY" "$EXEDIR\$0" ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "GPGHomeDirectory" StrCpy "$GPGHOMEDIRECTORY" "$EXEDIR\$0" ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "AdditionalParameters" StrCpy "$ADDITIONALPARAMETERS" $0 ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "AllowMultipleInstances" StrCpy "$ALLOWMULTIPLEINSTANCES" $0 ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "SkipChromeFix" StrCpy "$SKIPCHROMEFIX" $0 ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "SkipCompregFix" StrCpy "$SKIPCOMPREGFIX" $0 ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "${APP}Executable" StrCpy "$PROGRAMEXECUTABLE" $0 ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "DisableIntelligentStart" StrCpy $DISABLEINTELLIGENTSTART $0 ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "DisableSplashScreen" StrCpy "$DISABLESPLASHSCREEN" $0 ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "RunLocally" StrCpy "$RUNLOCALLY" $0 ;CleanUpAnyErrors: ;=== Any missing unrequired INI entries will be an empty string, ignore associated errors ClearErrors ;=== Check if default directories StrCmp $PROGRAMDIRECTORY "$EXEDIR\App\${DEFAULTAPPDIR}" "" EndINI StrCmp $PROFILEDIRECTORY "$EXEDIR\Data\profile" "" EndINI StrCmp $PLUGINSDIRECTORY "$EXEDIR\Data\plugins" "" EndINI StrCmp $SETTINGSDIRECTORY "$EXEDIR\Data\settings" "" EndINI StrCmp $GPGPATHDIRECTORY "$EXEDIR\App\${DEFAULTGPGPATH}" "" EndINI StrCmp $GPGHOMEDIRECTORY "$EXEDIR\Data\${DEFAULTGPGHOME}" "" EndINI StrCpy $ISDEFAULTDIRECTORY "true" Goto EndINI NoINI: ;=== No INI file, so we'll use the defaults StrCpy $ADDITIONALPARAMETERS "" StrCpy $ALLOWMULTIPLEINSTANCES "false" StrCpy $SKIPCHROMEFIX "false" StrCpy $SKIPCOMPREGFIX "false" StrCpy $WAITFORPROGRAM "false" StrCpy $PROGRAMEXECUTABLE "${DEFAULTEXE}" StrCpy $DISABLESPLASHSCREEN "false" IfFileExists "$EXEDIR\App\${DEFAULTAPPDIR}\${DEFAULTEXE}" "" NoProgramEXE StrCpy $PROGRAMDIRECTORY "$EXEDIR\App\${DEFAULTAPPDIR}" StrCpy $PROFILEDIRECTORY "$EXEDIR\Data\profile" StrCpy $PLUGINSDIRECTORY "$EXEDIR\Data\plugins" StrCpy $SETTINGSDIRECTORY "$EXEDIR\Data\settings" StrCpy $GPGPATHDIRECTORY "$EXEDIR\App\${DEFAULTGPGPATH}" StrCpy $GPGHOMEDIRECTORY "$EXEDIR\Data\${DEFAULTGPGHOME}" StrCpy $ISDEFAULTDIRECTORY "true" StrCpy $DISABLEINTELLIGENTSTART "false" EndINI: IfFileExists "$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE" FoundProgramEXE NoProgramEXE: ;=== Program executable not where expected MessageBox MB_OK|MB_ICONEXCLAMATION `$PROGRAMEXECUTABLE was not found. Please check your configuration` Abort FoundProgramEXE: ;=== Check if Thunderbird is running StrCmp $ALLOWMULTIPLEINSTANCES "true" ProfileWork FindProcDLL::FindProc "thunderbird.exe" Pop $R0 StrCmp $R0 "1" "" ProfileWork ;=== already running, check if it is using the portable profile IfFileExists "$PROFILEDIRECTORY\parent.lock" "" WarnAnotherInstance StrCpy $SECONDARYLAUNCH "true" Goto GetPassedParameters WarnAnotherInstance: MessageBox MB_OK|MB_ICONINFORMATION `Another instance of ${APP} is already running. Please close other instances of ${APP} before launching ${FULLNAME}.` Abort ProfileWork: ;=== Check for an existing profile IfFileExists "$PROFILEDIRECTORY\prefs.js" ProfileFound ;=== No profile was found StrCmp $ISDEFAULTDIRECTORY "true" CopyDefaultProfile MessageBox MB_YESNO|MB_ICONQUESTION `No profile was found. Create a new profile here? $\n$PROFILEDIRECTORY\` IDYES CreateProfile MessageBox MB_OK|MB_ICONINFORMATION `${NAME} can not run without a profile directory. Please check your configuration.` Abort CopyDefaultProfile: CreateDirectory "$EXEDIR\Data" CreateDirectory "$EXEDIR\Data\plugins" CreateDirectory "$EXEDIR\Data\profile" CreateDirectory "$EXEDIR\Data\gpg" CopyFiles /SILENT $EXEDIR\App\DefaultData\plugins\*.* $EXEDIR\Data\plugins CopyFiles /SILENT $EXEDIR\App\DefaultData\profile\*.* $EXEDIR\Data\profile CopyFiles /SILENT $EXEDIR\App\DefaultData\gpg\*.* $EXEDIR\Data\gpg IfFileExists "$EXEDIR\Data\settings\ThunderbirdPortableSettings.ini" ProfileFound CreateDirectory "$EXEDIR\Data\settings" CopyFiles /SILENT $EXEDIR\App\DefaultData\settings\*.* $EXEDIR\Data\settings GoTo ProfileFound CreateProfile: IfFileExists "$PROFILEDIRECTORY\*.*" ProfileFound CreateDirectory "$PROFILEDIRECTORY" ProfileFound: IfFileExists "$SETTINGSDIRECTORY\ThunderbirdPortableSettings.ini" SettingsFound CreateDirectory "$SETTINGSDIRECTORY" FileOpen $R0 "$SETTINGSDIRECTORY\ThunderbirdPortableSettings.ini" w FileClose $R0 WriteINIStr "$SETTINGSDIRECTORY\ThunderbirdPortableSettings.ini" "ThunderbirdPortableSettings" "LastProfileDirectory" "NONE" SettingsFound: StrCmp $SHOWLICENSE "true" "" CheckForLicense WriteINIStr "$SETTINGSDIRECTORY\ThunderbirdPortableSettings.ini" "ThunderbirdPortableSettings" "AgreedToLicense" "YES" Goto TheEnd CheckForLicense: ReadINIStr $0 "$SETTINGSDIRECTORY\ThunderbirdPortableSettings.ini" "ThunderbirdPortableSettings" "AgreedToLicense" StrCmp $0 "YES" LicenseAgreedTo RelaunchWithLicense RelaunchWithLicense: System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1' ExecWait `$R0 SHOWLICENSE` ReadINIStr $0 "$SETTINGSDIRECTORY\ThunderbirdPortableSettings.ini" "ThunderbirdPortableSettings" "AgreedToLicense" StrCmp $0 "YES" LicenseAgreedTo TheEnd LicenseAgreedTo: ;=== Check for read/write StrCmp $RUNLOCALLY "true" DisplaySplash ClearErrors FileOpen $R0 "$PROFILEDIRECTORY\writetest.temp" w IfErrors "" WriteSuccessful ;== Write failed, so we're read-only MessageBox MB_YESNO|MB_ICONQUESTION `${FULLNAME} appears to be running from a location that is read-only. Would you like to temporarily copy it to the local hard drive and run it from there?$\n$\n(Privacy Note: Any personal data within ${FULLNAME} will be copied to a local drive. Although it will be deleted on exit, it may be possible to recover this data later.)` IDYES SwitchToRunLocally MessageBox MB_OK|MB_ICONINFORMATION `${FULLNAME} can not run directly from a read-only location and will now close.` Abort SwitchToRunLocally: ClearErrors StrCpy $RUNLOCALLY "true" StrCpy $WAITFORPROGRAM "true" Goto DisplaySplash WriteSuccessful: FileClose $R0 Delete "$PROFILEDIRECTORY\writetest.temp" DisplaySplash: StrCmp $DISABLESPLASHSCREEN "true" SkipSplashScreen ;=== Show the splash screen before processing the files InitPluginsDir File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg" newadvsplash::show /NOUNLOAD 2500 200 0 -1 /L $PLUGINSDIR\splash.jpg SkipSplashScreen: ;=== Run locally if needed (aka Portable Thunderbird Live) StrCmp $RUNLOCALLY "true" "" CompareProfilePath RMDir /r "$TEMP\${NAME}\" CreateDirectory $TEMP\${NAME}\profile CreateDirectory $TEMP\${NAME}\plugins CreateDirectory $TEMP\${NAME}\program CreateDirectory $TEMP\${NAME}\gpghome CreateDirectory $TEMP\${NAME}\gpgpath CreateDirectory $TEMP\${NAME}\registry CopyFiles /SILENT $PROFILEDIRECTORY\*.* $TEMP\${NAME}\profile StrCpy $PROFILEDIRECTORY $TEMP\${NAME}\profile CopyFiles /SILENT $PLUGINSDIRECTORY\*.* $TEMP\${NAME}\plugins StrCpy $PROFILEDIRECTORY $TEMP\${NAME}\profile CopyFiles /SILENT $PROGRAMDIRECTORY\*.* $TEMP\${NAME}\program StrCpy $PROGRAMDIRECTORY $TEMP\${NAME}\program CopyFiles /SILENT $GPGPATHDIRECTORY\*.* $TEMP\${NAME}\gpgpath StrCpy $GPGPATHDIRECTORY $TEMP\${NAME}\gpgpath CopyFiles /SILENT $GPGHOMEDIRECTORY\*.* $TEMP\${NAME}\gpghome StrCpy $GPGHOMEDIRECTORY $TEMP\${NAME}\gpghome Push $TEMP\${NAME} Call Attrib CompareProfilePath: ReadINIStr $LASTPROFILEDIRECTORY "$SETTINGSDIRECTORY\${NAME}Settings.ini" "${NAME}Settings" "LastProfileDirectory" StrCmp $PROFILEDIRECTORY $LASTPROFILEDIRECTORY "" AdjustChrome StrCmp $DISABLEINTELLIGENTSTART "true" AdjustChrome StrCpy $SKIPCHROMEFIX "true" StrCpy $SKIPCOMPREGFIX "true" AdjustChrome: WriteINIStr "$SETTINGSDIRECTORY\${NAME}Settings.ini" "${NAME}Settings" "LastProfileDirectory" "$PROFILEDIRECTORY" ;=== Adjust the chrome.rdf StrCmp $SKIPCHROMEFIX "true" RunProgram IfFileExists "$PROFILEDIRECTORY\chrome\chrome.rdf" "" FixCalendarManager FileOpen $0 "$PROFILEDIRECTORY\chrome\chrome.rdf" r FileOpen $R0 "$PROFILEDIRECTORY\chrome\chrome.rdf.new" w ClearErrors ; if there's an error, we're done with the file NextLine: FileWrite $R0 $4 FileRead $0 $4 IfErrors NoMoreLines ;== we've reached the end of the file StrCpy $5 $4 35 StrCmp $5 ` c:baseURL="jar:f` FoundJarLine StrCmp $5 ` c:baseURL="file:` FoundFileLine NextLine FoundJarLine: StrCpy $R4 40 StrCpy $ISFILELINE "0" GoTo NotYet FoundFileLine: StrCpy $R4 40 StrCpy $ISFILELINE "1" NotYet: IntOp $R4 $R4 + 1 StrCpy $7 $4 10 $R4 ;=== looking for the point to strip the extension path StrCmp $7 "extensions" PathFound NotYet PathFound: StrCpy $5 $4 "" $R4 StrCmp $ISFILELINE "0" MakeJarLine MakeFileLine MakeJarLine: StrCpy $4 ` c:baseURL="jar:file:///$PROFILEDIRECTORY/$5` GoTo NextLine MakeFileLine: StrCpy $4 ` c:baseURL="file:///$PROFILEDIRECTORY/$5` GoTo NextLine NoMoreLines: FileClose $0 FileClose $R0 ;=== Backup the chrome.rdf CopyFiles /SILENT "$PROFILEDIRECTORY\chrome\chrome.rdf" "$PROFILEDIRECTORY\chrome\chrome.rdf.old" CopyFiles /SILENT "$PROFILEDIRECTORY\chrome\chrome.rdf.new" "$PROFILEDIRECTORY\chrome\chrome.rdf" FixCalendarManager: IfFileExists "$PROFILEDIRECTORY\Calendar\CalendarManager.rdf" "" RunProgram FileOpen $0 "$PROFILEDIRECTORY\Calendar\CalendarManager.rdf" r FileOpen $R0 "$PROFILEDIRECTORY\Calendar\CalendarManager.rdf.new" w ClearErrors ; if there's an error, we're done with the file CMNextLine: FileWrite $R0 $4 FileRead $0 $4 IfErrors CMNoMoreLines ;== we've reached the end of the file StrCpy $5 $4 28 StrCmp $5 ` NC:path="` "" CMNextLine StrCpy $R4 28 CMNotYet: IntOp $R4 $R4 + 1 StrCpy $7 $4 9 $R4 ; looking for the point to strip the calendar path StrCmp $7 "Calendar\" "" CMNotYet StrCpy $5 $4 "" $R4 StrCpy $4 ` NC:path="$PROFILEDIRECTORY\$5` ;=== the adjusted extension path GoTo CMNextLine CMNoMoreLines: FileClose $0 FileClose $R0 ;=== Backup the Calendar\CalendarManager.rdf just in case CopyFiles /SILENT "$PROFILEDIRECTORY\Calendar\CalendarManager.rdf" "$PROFILEDIRECTORY\Calendar\CalendarManager.rdf.old" CopyFiles /SILENT "$PROFILEDIRECTORY\Calendar\CalendarManager.rdf.new" "$PROFILEDIRECTORY\Calendar\CalendarManager.rdf" RunProgram: StrCmp $SKIPCOMPREGFIX "true" GetPassedParameters ;=== Delete component registry to ensure compatibility with all extensions Delete $PROFILEDIRECTORY\compreg.dat GetPassedParameters: ;=== Get any passed parameters Call GetParameters Pop $0 StrCmp "'$0'" "''" "" LaunchProgramParameters ;=== No parameters StrCpy $EXECSTRING `"$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE" -profile "$PROFILEDIRECTORY"` Goto CheckMultipleInstances LaunchProgramParameters: StrCpy $EXECSTRING `"$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE" -profile "$PROFILEDIRECTORY" $0` CheckMultipleInstances: StrCmp $ALLOWMULTIPLEINSTANCES "true" "" AdditionalParameters System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("MOZ_NO_REMOTE", "1").r0' AdditionalParameters: StrCmp $ADDITIONALPARAMETERS "" PluginsEnvironment ;=== Additional Parameters StrCpy $EXECSTRING `$EXECSTRING $ADDITIONALPARAMETERS` PluginsEnvironment: ;=== Set the plugins directory if we have a path StrCmp $PLUGINSDIRECTORY "" GPGEnvironment IfFileExists "$PLUGINSDIRECTORY\*.*" "" GPGEnvironment System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("MOZ_PLUGIN_PATH", "$PLUGINSDIRECTORY").r0' GPGEnvironment: ;=== Set the GPG Environment if the files are present IfFileExists "$GPGPATHDIRECTORY\gpg.exe" "" LaunchNow ;=== Setup the Path so that gpg.exe can be found by Enigmail ReadEnvStr $R0 "PATH" StrCpy $R0 "$GPGPATHDIRECTORY;$R0" System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PATH", "$R0").r0' ;=== Setup GNUPGHOME so that we don't have to use the registry StrCpy $R0 "$GPGHOMEDIRECTORY" System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("GNUPGHOME", "$R0").r0' IfFileExists "$PROFILEDIRECTORY\prefs.js" "" LaunchNow FileOpen $0 "$PROFILEDIRECTORY\prefs.js" a FileSeek $0 0 END FileWriteByte $0 "13" FileWriteByte $0 "10" FileWrite $0 `user_pref("extensions.enigmail.agentPath", "$GPGPATHDIRECTORY\gpg.exe");` FileWriteByte $0 "13" FileWriteByte $0 "10" FileClose $0 LaunchNow: StrCmp $ALLOWMULTIPLEINSTANCES "true" StartProgramNow StrCmp $SECONDARYLAUNCH "true" StartProgramAndExit ;=== Check for registry permissions UserInfo::GetAccountType Pop $0 StrCpy $USERTYPE $0 StrCmp $USERTYPE "Guest" StartProgramNow ${registry::KeyExists} "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UnreadMail" $R0 StrCmp $R0 "-1" +2 ;=== If it doesn't exist, skip the next line ${registry::CopyKey} "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UnreadMail" "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UnreadMail-BackupByThunderbirdPortable" $R0 StrCmp $USERTYPE "User" StartProgramNow ${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Thunderbird" $R0 StrCmp $R0 "-1" +3 ;=== If it doesn't exist, skip the next 2 lines ${registry::MoveKey} "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Thunderbird" "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Thunderbird-BackupByThunderbirdPortable" $R0 Sleep 100 ${registry::Write} "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Thunderbird\Desktop" "showMapiDialog" "0" "REG_SZ" $R0 Sleep 100 StartProgramNow: ExecWait $EXECSTRING StrCmp $ALLOWMULTIPLEINSTANCES "true" TheEnd CheckRunning: Sleep 2000 FindProcDLL::FindProc "thunderbird.exe" Pop $R0 StrCmp $R0 "1" "" TheEnd IfFileExists "$PROFILEDIRECTORY\parent.lock" CheckRunning TheEnd StartProgramAndExit: Exec $EXECSTRING Goto TheRealEnd TheEnd: ;=== Restore registry keys StrCmp $USERTYPE "Guest" EndWithoutRegRestore ${registry::KeyExists} "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UnreadMail-BackupByThunderbirdPortable" $R0 StrCmp $R0 "-1" +4 ;=== If it doesn't exist, skip the next 3 lines ${registry::DeleteKey} "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UnreadMail" $R0 Sleep 100 ${registry::MoveKey} "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UnreadMail-BackupByThunderbirdPortable" "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UnreadMail" $R0 StrCmp $USERTYPE "User" EndWithoutRegRestore ${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Thunderbird-BackupByThunderbirdPortable" $R0 StrCmp $R0 "-1" EndWithoutRegRestore ${registry::DeleteKey} "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Thunderbird" $R0 Sleep 100 ${registry::MoveKey} "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Thunderbird-BackupByThunderbirdPortable" "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Thunderbird" $R0 EndWithoutRegRestore: StrCmp $DISABLESPLASHSCREEN "true" CleanupRunLocally Sleep 2000 newadvsplash::stop CleanupRunLocally: StrCmp $RUNLOCALLY "true" "" TheRealEnd RMDir /r "$TEMP\${NAME}\" TheRealEnd: ${registry::Unload} newadvsplash::wait RMDir "$APPDATA\Mozilla\" ;=== Will only delete if empty (no /r switch) RMDir "$APPDATA\Thunderbird\" ;=== Will only delete if empty (no /r switch) SectionEnd