;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. !define NAME "WhateverPortable" !define FULLNAME "Whatever Portable" !define APP "Whatever" !define VER "3.1.4.2" !define WEBSITE "Example.com" ;=== Program Details Name "${FULLNAME}" OutFile "${NAME}.exe" Caption "${FULLNAME} | Example.com" VIProductVersion "${VER}" VIAddVersionKey ProductName "${FULLNAME}" VIAddVersionKey Comments "Allows ${APP} to be run from a removable drive. For additional details, visit ${WEBSITE}" VIAddVersionKey CompanyName "Example.com (Your Name)" VIAddVersionKey LegalCopyright "Your Name" VIAddVersionKey FileDescription "${FULLNAME}" VIAddVersionKey FileVersion "${VER}" VIAddVersionKey ProductVersion "${VER}" VIAddVersionKey InternalName "${FULLNAME}" VIAddVersionKey LegalTrademarks "Example.com is a trademark of Example Company" VIAddVersionKey OriginalFilename "${NAME}.exe" ;VIAddVersionKey PrivateBuild "" ;VIAddVersionKey SpecialBuild "" ;=== Runtime Switches CRCCheck On WindowIcon Off SilentInstall Silent AutoCloseWindow True RequestExecutionLevel user ;=== Program Icon Icon "${NAME}.ico" Section "Main" FindProcDLL::FindProc "whatever.exe" ;if running, exit StrCmp $R0 "1" TheEnd SettingsBackup: IfFileExists "$APPDATA\Whatever\*.*" 0 SettingsDirectory Rename "$APPDATA\Whatever" "$EXEDIR\Data\backup" SettingsDirectory: ;=== Set the settings directory if we have a path IfFileExists "$EXEDIR\Data\settings\*.*" RestoreSettings CreateDirectory "$EXEDIR\Data" CreateDirectory "$EXEDIR\Data\settings" CopyFiles /SILENT "$EXEDIR\App\DefaultData\settings\*.*" "$EXEDIR\Data\settings" RestoreSettings: Rename "$EXEDIR\Data\settings" "$APPDATA\Whatever" RunWhatever: ExecWait "$EXEDIR\App\whatever\whatever.exe" BackupSettings: Rename "$APPDATA\Whatever" "$EXEDIR\Data\settings" ;SetOriginalSettingsBack: IfFileExists "$EXEDIR\Data\backup" 0 TheEnd Rename "$EXEDIR\Data\backup" "$APPDATA\Whatever" TheEnd: SectionEnd