├── App ├── AppInfo │ ├── Launcher │ │ ├── Custom.nsh │ │ ├── Debug.nsh │ │ ├── SourceTreePortable.ini │ │ └── splash.jpg │ ├── appicon.ico │ ├── appicon_16.png │ ├── appicon_32.png │ └── appinfo.ini └── readme.txt ├── Other ├── Help │ └── images │ │ ├── donation_button.png │ │ ├── favicon.ico │ │ ├── help_background_footer.png │ │ ├── help_background_header.png │ │ └── help_logo_top.png └── Source │ ├── License.txt │ ├── PortableApps.comInstaller.nsi.orig │ ├── PortableApps.comInstallerCustom.nsh │ └── Readme.txt ├── README.md └── help.html /App/AppInfo/Launcher/Custom.nsh: -------------------------------------------------------------------------------- 1 | ; This script will get the last part of a string after a specified character. 2 | ; Useful to get file extensions, last file name or last directory part. 3 | 4 | Function GetAfterChar 5 | Exch $0 ; chop char 6 | Exch 7 | Exch $1 ; input string 8 | Push $2 9 | Push $3 10 | StrCpy $2 0 11 | loop: 12 | IntOp $2 $2 - 1 13 | StrCpy $3 $1 1 $2 14 | StrCmp $3 "" 0 +3 15 | StrCpy $0 "" 16 | Goto exit2 17 | StrCmp $3 $0 exit1 18 | Goto loop 19 | exit1: 20 | IntOp $2 $2 + 1 21 | StrCpy $0 $1 "" $2 22 | exit2: 23 | Pop $3 24 | Pop $2 25 | Pop $1 26 | Exch $0 ; output 27 | FunctionEnd 28 | 29 | !macro _getAfterCharConstructor OUT PATH SEPARATOR 30 | Push "${PATH}" 31 | Push "${SEPARATOR}" 32 | Call GetAfterChar 33 | Pop "${OUT}" 34 | !macroend 35 | 36 | !define GetAfterChar '!insertmacro "_getAfterCharConstructor"' 37 | 38 | ; StrReplace 39 | ; Replaces all occurrences of a given needle within a haystack with another string 40 | ; Written by dandaman32 41 | 42 | Var STR_REPLACE_VAR_0 43 | Var STR_REPLACE_VAR_1 44 | Var STR_REPLACE_VAR_2 45 | Var STR_REPLACE_VAR_3 46 | Var STR_REPLACE_VAR_4 47 | Var STR_REPLACE_VAR_5 48 | Var STR_REPLACE_VAR_6 49 | Var STR_REPLACE_VAR_7 50 | Var STR_REPLACE_VAR_8 51 | 52 | Function StrReplace 53 | Exch $STR_REPLACE_VAR_2 54 | Exch 1 55 | Exch $STR_REPLACE_VAR_1 56 | Exch 2 57 | Exch $STR_REPLACE_VAR_0 58 | StrCpy $STR_REPLACE_VAR_3 -1 59 | StrLen $STR_REPLACE_VAR_4 $STR_REPLACE_VAR_1 60 | StrLen $STR_REPLACE_VAR_6 $STR_REPLACE_VAR_0 61 | loop: 62 | IntOp $STR_REPLACE_VAR_3 $STR_REPLACE_VAR_3 + 1 63 | StrCpy $STR_REPLACE_VAR_5 $STR_REPLACE_VAR_0 $STR_REPLACE_VAR_4 $STR_REPLACE_VAR_3 64 | StrCmp $STR_REPLACE_VAR_5 $STR_REPLACE_VAR_1 found 65 | StrCmp $STR_REPLACE_VAR_3 $STR_REPLACE_VAR_6 done 66 | Goto loop 67 | found: 68 | StrCpy $STR_REPLACE_VAR_5 $STR_REPLACE_VAR_0 $STR_REPLACE_VAR_3 69 | IntOp $STR_REPLACE_VAR_8 $STR_REPLACE_VAR_3 + $STR_REPLACE_VAR_4 70 | StrCpy $STR_REPLACE_VAR_7 $STR_REPLACE_VAR_0 "" $STR_REPLACE_VAR_8 71 | StrCpy $STR_REPLACE_VAR_0 $STR_REPLACE_VAR_5$STR_REPLACE_VAR_2$STR_REPLACE_VAR_7 72 | StrLen $STR_REPLACE_VAR_6 $STR_REPLACE_VAR_0 73 | Goto loop 74 | done: 75 | Pop $STR_REPLACE_VAR_1 ; Prevent "invalid opcode" errors and keep the 76 | Pop $STR_REPLACE_VAR_1 ; stack as it was before the function was called 77 | Exch $STR_REPLACE_VAR_0 78 | FunctionEnd 79 | 80 | !macro _strReplaceConstructor OUT NEEDLE NEEDLE2 HAYSTACK 81 | Push "${HAYSTACK}" 82 | Push "${NEEDLE}" 83 | Push "${NEEDLE2}" 84 | Call StrReplace 85 | Pop "${OUT}" 86 | !macroend 87 | 88 | !define StrReplace '!insertmacro "_strReplaceConstructor"' 89 | 90 | Function BackupUserConfig 91 | ;${DebugMsg} "SourceTree user config directory is $R8" 92 | WriteINIStr $EXEDIR\Data\settings\$AppIDSettings.ini $AppIDSettings LastUserConfigPath $R8 93 | 94 | ; Check if LastUserConfigPath has changed 95 | StrCmp $R0 $R8 0 notfound 96 | ; Backup user.config 97 | ${If} ${FileExists} $R8\user.config 98 | CopyFiles /SILENT $R8\user.config $EXEDIR\Data 99 | ${EndIf} 100 | ; Backup opentabs.xml 101 | ${If} ${FileExists} $EXEDIR\Data\ClientFiles\SourceTree\opentabs.xml 102 | CopyFiles /SILENT $EXEDIR\Data\ClientFiles\SourceTree\opentabs.xml $EXEDIR\Data 103 | ${EndIf} 104 | ; Backup bookmarks.xml 105 | ${If} ${FileExists} $EXEDIR\Data\ClientFiles\SourceTree\bookmarks.xml 106 | CopyFiles /SILENT $EXEDIR\Data\ClientFiles\SourceTree\bookmarks.xml $EXEDIR\Data 107 | ${EndIf} 108 | Goto done 109 | notfound: 110 | ; Restore backuped user.config 111 | ${If} ${FileExists} $EXEDIR\Data\user.config 112 | CopyFiles /SILENT $EXEDIR\Data\user.config $R8 113 | ${EndIf} 114 | ; Restore backuped opentabs.xml 115 | ${If} ${FileExists} $EXEDIR\Data\opentabs.xml 116 | CopyFiles /SILENT $EXEDIR\Data\opentabs.xml $EXEDIR\Data\ClientFiles\SourceTree 117 | ${EndIf} 118 | ; Restore backuped bookmarks.xml 119 | ${If} ${FileExists} $EXEDIR\Data\bookmarks.xml 120 | CopyFiles /SILENT $EXEDIR\Data\bookmarks.xml $EXEDIR\Data\ClientFiles\SourceTree 121 | ${EndIf} 122 | done: 123 | FunctionEnd 124 | 125 | ${SegmentFile} 126 | 127 | Var LastLocalAppData 128 | Var LastDocuments 129 | Var LastUserConfigPath 130 | 131 | ${SegmentPre} 132 | 133 | ClearErrors 134 | 135 | ; Custom Code for using last LOCALAPPDATA in launcher.ini[Environment] - use %LastLocalAppData% 136 | ReadINIStr $LastLocalAppData $EXEDIR\Data\settings\$AppIDSettings.ini $AppIDSettings LastLocalAppData 137 | StrCpy $0 $LastLocalAppData 138 | ${SetEnvironmentVariable} LastLocalAppData $0 139 | ${DebugMsg} "SourceTree LastLocalAppData is $LastLocalAppData" 140 | 141 | ; Custom Code for using last DOCUMENTS in launcher.ini[Environment] - use %LastDocuments% 142 | ReadINIStr $LastDocuments $EXEDIR\Data\settings\$AppIDSettings.ini $AppIDSettings LastDocuments 143 | StrCpy $0 $LastDocuments 144 | ${SetEnvironmentVariable} LastDocuments $0 145 | ${DebugMsg} "SourceTree LastDocuments is $LastDocuments" 146 | 147 | ; Custom Code for using last LastUserConfigPath in launcher.ini[Environment] - use %LastUserConfigPath% 148 | ReadINIStr $LastUserConfigPath $EXEDIR\Data\settings\$AppIDSettings.ini $AppIDSettings LastUserConfigPath 149 | StrCpy $0 $LastUserConfigPath 150 | ${SetEnvironmentVariable} LastUserConfigPath $0 151 | ${DebugMsg} "SourceTree LastUserConfigPath is $LastUserConfigPath" 152 | 153 | ; Custom Code for using last DOCUMENTS with double backslash in launcher.ini[Environment] - use %LastDocuments:DoubleBackslash% 154 | ${StrReplace} $0 '\' '??' $LastDocuments 155 | ${StrReplace} $1 '??' '\\' $0 156 | ${SetEnvironmentVariable} LastDocuments:DoubleBackslash $1 157 | ${DebugMsg} "SourceTree LastDocuments:DoubleBackslash is $1" 158 | 159 | ; Check if LastPortableAppsBaseDir has changed 160 | StrCmp $EXEDIR $LastDrive$LastDirectory done 161 | error: 162 | ${DebugMsg} "SourceTree LastPortableAppsBaseDir has changed." 163 | MessageBox MB_OK|MB_ICONSTOP "The path to the App directory which contains the portable app$\r$\nhas changed since last start up. To restore user settings,$\r$\nskip setup and restart SourceTree." 164 | ${GetParent} $LastUserConfigPath $0 165 | ${GetAfterChar} $1 $0 "\" 166 | ${DebugMsg} "SourceTree delete old user config directory $EXEDIR\Data\ClientFiles\$1" 167 | RMDir /r $EXEDIR\Data\ClientFiles\$1 168 | done: 169 | 170 | !macroend 171 | 172 | ${SegmentPost} 173 | 174 | ; Pass $LastUserConfigPath to BackupUserConfig function 175 | StrCpy $R0 $LastUserConfigPath 176 | ${Locate} "$EXEDIR\Data\ClientFiles" "/L=F /M=user.config" "BackupUserConfig" 177 | 178 | ; Kill pageant.exe 179 | Exec "taskkill /im pageant.exe /f" 180 | 181 | !macroend -------------------------------------------------------------------------------- /App/AppInfo/Launcher/Debug.nsh: -------------------------------------------------------------------------------- 1 | ;!define DEBUG_ALL 2 | ;!define DEBUG_OUTPUT file -------------------------------------------------------------------------------- /App/AppInfo/Launcher/SourceTreePortable.ini: -------------------------------------------------------------------------------- 1 | [Launch] 2 | ProgramExecutable=SourceTree\SourceTree.exe 3 | WorkingDirectory=%PAL:AppDir%\SourceTree 4 | SingleAppInstance=true 5 | DirectoryMoveOK=yes 6 | RunAsAdmin=try 7 | 8 | [Activate] 9 | Registry=true 10 | XML=true 11 | 12 | [FileWrite1] 13 | File=%PAL:DataDir%\settings\SourceTreePortableSettings.ini 14 | Type=INI 15 | Section=SourceTreePortableSettings 16 | Key=LastLocalAppData 17 | Value=%LOCALAPPDATA% 18 | 19 | [FileWrite2] 20 | File=%PAL:DataDir%\settings\SourceTreePortableSettings.ini 21 | Type=INI 22 | Section=SourceTreePortableSettings 23 | Key=LastDocuments 24 | Value=%DOCUMENTS% 25 | 26 | [FileWrite3] 27 | File=%PAL:DataDir%\ClientFiles\SourceTree\hgrc_sourcetree 28 | Type=Replace 29 | Find=%PAL:LastDrive%%PAL:LastPackagePartialDir% 30 | Replace=%PAL:Drive%%PAL:PackagePartialDir% 31 | 32 | [FileWrite4] 33 | File=%PAL:DataDir%\ClientFiles\SourceTree\hgrc_sourcetree 34 | Type=Replace 35 | Find=%LastLocalAppData% 36 | Replace=%LOCALAPPDATA% 37 | 38 | [FileWrite5] 39 | File=%PAL:DataDir%\.gitconfig 40 | Type=Replace 41 | Find=%LastDocuments:DoubleBackslash% 42 | Replace=%DOCUMENTS:DoubleBackslash% 43 | 44 | [FileWrite6] 45 | File=%PAL:DataDir%\mercurial.ini 46 | Type=Replace 47 | Find=%LastDocuments% 48 | Replace=%DOCUMENTS% 49 | 50 | [FileWrite7] 51 | File=%PAL:AppDir%\SourceTree\log4net.config 52 | Type=XML attribute 53 | XPath=/configuration/log4net/appender/file 54 | Attribute=value 55 | Value=%LOCALAPPDATA%\Atlassian\SourceTree\sourcetree.log 56 | 57 | [FileWrite8] 58 | File=%PAL:DataDir%\user.config 59 | Type=Replace 60 | Find=%LastDocuments% 61 | Replace=%DOCUMENTS% 62 | 63 | [FileWrite9] 64 | File=%PAL:DataDir%\user.config 65 | Type=Replace 66 | Find=%LastLocalAppData% 67 | Replace=%LOCALAPPDATA% 68 | 69 | [FileWrite10] 70 | File=%PAL:DataDir%\settings\SourceTreeUserSettings.reg 71 | Type=Replace 72 | Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:DoubleBackslash% 73 | Replace=%PAL:Drive%%PAL:PackagePartialDir:DoubleBackslash% 74 | 75 | [DirectoriesMove] 76 | ClientFiles=%LOCALAPPDATA%\Atlassian 77 | SourceTreeProgramData=%LOCALAPPDATA%\SourceTree 78 | SourceTreeSettings=%LOCALAPPDATA%\SourceTree-Settings 79 | SquirrelTempData=%LOCALAPPDATA%\SquirrelTemp 80 | 81 | [FilesMove] 82 | gitignore_global.txt=%DOCUMENTS% 83 | hgignore_global.txt=%DOCUMENTS% 84 | .gitconfig=%USERPROFILE% 85 | mercurial.ini=%USERPROFILE% 86 | .bash_history=%USERPROFILE% 87 | 88 | [RegistryKeys] 89 | SourceTreeUserSettings=HKCU\Software\Classes\sourcetree 90 | 91 | [RegistryCleanupIfEmpty] 92 | 1=HKCU\Software\Classes\sourcetree 93 | 94 | [RegistryCleanupForce] 95 | 1=HKLM\SOFTWARE\Microsoft\Tracing\SourceTree_RASAPI32 96 | 2=HKLM\SOFTWARE\Microsoft\Tracing\SourceTree_RASMANCS 97 | -------------------------------------------------------------------------------- /App/AppInfo/Launcher/splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmomill/SourceTreePortable/f6e3e869bedd84599bb5239891695ae4de675fc7/App/AppInfo/Launcher/splash.jpg -------------------------------------------------------------------------------- /App/AppInfo/appicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmomill/SourceTreePortable/f6e3e869bedd84599bb5239891695ae4de675fc7/App/AppInfo/appicon.ico -------------------------------------------------------------------------------- /App/AppInfo/appicon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmomill/SourceTreePortable/f6e3e869bedd84599bb5239891695ae4de675fc7/App/AppInfo/appicon_16.png -------------------------------------------------------------------------------- /App/AppInfo/appicon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmomill/SourceTreePortable/f6e3e869bedd84599bb5239891695ae4de675fc7/App/AppInfo/appicon_32.png -------------------------------------------------------------------------------- /App/AppInfo/appinfo.ini: -------------------------------------------------------------------------------- 1 | [Format] 2 | Type=PortableApps.comFormat 3 | Version=3.0 4 | 5 | [Details] 6 | Name=Atlassian SourceTree 7 | AppID=SourceTreePortable 8 | Publisher=Atlassian 9 | Homepage=https://www.sourcetreeapp.com/ 10 | Category=Repository Utilities 11 | Description=SourceTree, Portable Edition 12 | Language=Multilingual 13 | InstallType=English 14 | 15 | [License] 16 | Shareable=false 17 | OpenSource=false 18 | Freeware=false 19 | CommercialUse=false 20 | 21 | [Version] 22 | PackageVersion=2.0.19.1.0 23 | DisplayVersion=2.0.19.1 24 | 25 | [Control] 26 | Icons=1 27 | Start=SourceTreePortable.exe 28 | -------------------------------------------------------------------------------- /App/readme.txt: -------------------------------------------------------------------------------- 1 | The files in this directory are necessary for the portable application to 2 | function. There is normally no need to directly access or alter any of the 3 | files within these directories. 4 | -------------------------------------------------------------------------------- /Other/Help/images/donation_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmomill/SourceTreePortable/f6e3e869bedd84599bb5239891695ae4de675fc7/Other/Help/images/donation_button.png -------------------------------------------------------------------------------- /Other/Help/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmomill/SourceTreePortable/f6e3e869bedd84599bb5239891695ae4de675fc7/Other/Help/images/favicon.ico -------------------------------------------------------------------------------- /Other/Help/images/help_background_footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmomill/SourceTreePortable/f6e3e869bedd84599bb5239891695ae4de675fc7/Other/Help/images/help_background_footer.png -------------------------------------------------------------------------------- /Other/Help/images/help_background_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmomill/SourceTreePortable/f6e3e869bedd84599bb5239891695ae4de675fc7/Other/Help/images/help_background_header.png -------------------------------------------------------------------------------- /Other/Help/images/help_logo_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmomill/SourceTreePortable/f6e3e869bedd84599bb5239891695ae4de675fc7/Other/Help/images/help_logo_top.png -------------------------------------------------------------------------------- /Other/Source/License.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 261 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT 262 | PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED 263 | IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 264 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, 265 | EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 266 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 267 | A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY 268 | AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 269 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL 270 | NECESSARY SERVICING, REPAIR OR CORRECTION. 271 | 272 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR 273 | AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY 274 | OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM 275 | AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING 276 | ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES 277 | ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM 278 | (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 279 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 280 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY 281 | OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS 282 | BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 283 | 284 | END OF TERMS AND CONDITIONS 285 | 286 | How to Apply These Terms to Your New Programs 287 | 288 | If you develop a new program, and you want it to be of the greatest 289 | possible use to the public, the best way to achieve this is to make it 290 | free software which everyone can redistribute and change under these terms. 291 | 292 | To do so, attach the following notices to the program. It is safest 293 | to attach them to the start of each source file to most effectively 294 | convey the exclusion of warranty; and each file should have at least 295 | the "copyright" line and a pointer to where the full notice is found. 296 | 297 | 298 | Copyright (C) 19yy 299 | 300 | This program is free software; you can redistribute it and/or modify 301 | it under the terms of the GNU General Public License as published by 302 | the Free Software Foundation; either version 2 of the License, or 303 | (at your option) any later version. 304 | 305 | This program is distributed in the hope that it will be useful, 306 | but WITHOUT ANY WARRANTY; without even the implied warranty of 307 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 308 | GNU General Public License for more details. 309 | 310 | You should have received a copy of the GNU General Public License 311 | along with this program; if not, write to the Free Software 312 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 313 | 314 | 315 | Also add information on how to contact you by electronic and paper mail. 316 | 317 | If the program is interactive, make it output a short notice like this 318 | when it starts in an interactive mode: 319 | 320 | Gnomovision version 69, Copyright (C) 19yy name of author 321 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 322 | This is free software, and you are welcome to redistribute it 323 | under certain conditions; type `show c' for details. 324 | 325 | The hypothetical commands `show w' and `show c' should show the appropriate 326 | parts of the General Public License. Of course, the commands you use may 327 | be called something other than `show w' and `show c'; they could even be 328 | mouse-clicks or menu items--whatever suits your program. 329 | 330 | You should also get your employer (if you work as a programmer) or your 331 | school, if any, to sign a "copyright disclaimer" for the program, if 332 | necessary. Here is a sample; alter the names: 333 | 334 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 335 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 336 | 337 | , 1 April 1989 338 | Ty Coon, President of Vice 339 | 340 | This General Public License does not permit incorporating your program into 341 | proprietary programs. If your program is a subroutine library, you may 342 | consider it more useful to permit linking proprietary applications with the 343 | library. If this is what you want to do, use the GNU Library General 344 | Public License instead of this License. -------------------------------------------------------------------------------- /Other/Source/PortableApps.comInstaller.nsi.orig: -------------------------------------------------------------------------------- 1 | ;Copyright 2007-2013 John T. Haller of PortableApps.com 2 | ;Website: http://PortableApps.com/ 3 | 4 | ;This software is OSI Certified Open Source Software. 5 | ;OSI Certified is a certification mark of the Open Source Initiative. 6 | 7 | ;This program is free software; you can redistribute it and/or 8 | ;modify it under the terms of the GNU General Public License 9 | ;as published by the Free Software Foundation; either version 2 10 | ;of the License, or (at your option) any later version. 11 | 12 | ;This program is distributed in the hope that it will be useful, 13 | ;but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ;GNU General Public License for more details. 16 | 17 | ;You should have received a copy of the GNU General Public License 18 | ;along with this program; if not, write to the Free Software 19 | ;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 | 21 | ;EXCEPTION: The PortableApps.com Installer can be used with open source 22 | ;applications licensed under OSI-approved licenses as well as freeware provided 23 | ;it is unmodified and it adheres to the current PortableApps.com Format Specification 24 | ;as published at PortableApps.com/development. It may also be used with commercial 25 | ;software by contacting PortableApps.com. 26 | 27 | !define PORTABLEAPPSINSTALLERVERSION "3.0.6.0" 28 | !define PORTABLEAPPS.COMFORMATVERSION "3.0.6" 29 | 30 | !if ${__FILE__} == "PortableApps.comInstallerPlugin.nsi" 31 | !include PortableApps.comInstallerPluginConfig.nsh 32 | !define PLUGININSTALLER 33 | !else 34 | !include PortableApps.comInstallerConfig.nsh 35 | !endif 36 | 37 | !define MAINSECTIONIDX 0 38 | !ifdef MAINSECTIONTITLE 39 | !define OPTIONALSECTIONIDX 1 40 | !endif 41 | 42 | ;=== Program Details 43 | Name "${PORTABLEAPPNAME}" "${PORTABLEAPPNAMEDOUBLEDAMPERSANDS}" 44 | OutFile "..\..\..\${FILENAME}.paf.exe" 45 | !ifdef COMMONFILESPLUGIN 46 | InstallDir "\CommonFiles\${APPID}" 47 | !else 48 | InstallDir "\${APPID}" 49 | !endif 50 | Caption "${PORTABLEAPPNAME} | PortableApps.com Installer" 51 | VIProductVersion "${VERSION}" 52 | VIAddVersionKey ProductName "${PORTABLEAPPNAME}" 53 | VIAddVersionKey Comments "${INSTALLERCOMMENTS}" 54 | VIAddVersionKey CompanyName "PortableApps.com" 55 | VIAddVersionKey LegalCopyright "PortableApps.com Installer Copyright 2007-2012 PortableApps.com." 56 | VIAddVersionKey FileDescription "${PORTABLEAPPNAME}" 57 | VIAddVersionKey FileVersion "${VERSION}" 58 | VIAddVersionKey ProductVersion "${VERSION}" 59 | VIAddVersionKey InternalName "${PORTABLEAPPNAME}" 60 | VIAddVersionKey LegalTrademarks "${INSTALLERADDITIONALTRADEMARKS}PortableApps.com is a registered trademark of Rare Ideas, LLC." 61 | VIAddVersionKey OriginalFilename "${FILENAME}.paf.exe" 62 | VIAddVersionKey PortableApps.comInstallerVersion "${PORTABLEAPPSINSTALLERVERSION}" 63 | VIAddVersionKey PortableApps.comFormatVersion "${PORTABLEAPPS.COMFORMATVERSION}" 64 | VIAddVersionKey PortableApps.comAppID "${APPID}" 65 | !ifdef DownloadURL ;advertise the needed bits to the PA.c Updater 66 | VIAddVersionKey PortableApps.comDownloadURL "${DownloadURL}" 67 | VIAddVersionKey PortableApps.comDownloadName "${DownloadName}" 68 | VIAddVersionKey PortableApps.comDownloadFileName "${DownloadFileName}" 69 | VIAddVersionKey PortableApps.comDownloadMD5 "${DownloadMD5}" 70 | !endif 71 | 72 | ;=== Runtime Switches 73 | SetCompress Auto 74 | SetCompressor /SOLID lzma 75 | SetCompressorDictSize 32 76 | SetDatablockOptimize On 77 | CRCCheck on 78 | AutoCloseWindow True 79 | RequestExecutionLevel user 80 | AllowRootDirInstall true 81 | 82 | ;=== Include 83 | !include MUI.nsh 84 | !include FileFunc.nsh 85 | !include LogicLib.nsh 86 | !ifdef PRESERVEFILE1 87 | !include PortableApps.comInstallerMoveFiles.nsh 88 | !endif 89 | !ifdef COPYLOCALFILES 90 | !include Registry.nsh 91 | !endif 92 | !include TextFunc.nsh 93 | !include WordFunc.nsh 94 | !include PortableApps.comInstallerDumpLogToFile.nsh 95 | !include PortableApps.comInstallerTBProgress.nsh 96 | 97 | ;=== Program Icon 98 | Icon "PortableApps.comInstaller.ico" 99 | !define MUI_ICON "PortableApps.comInstaller.ico" 100 | !define MUI_UNICON "PortableApps.comInstaller.ico" 101 | !define MUI_HEADERIMAGE 102 | !define MUI_HEADERIMAGE_BITMAP "PortableApps.comInstallerHeader.bmp" 103 | !define MUI_HEADERIMAGE_BITMAP_RTL "PortableApps.comInstallerHeaderRTL.bmp" 104 | !define MUI_HEADERIMAGE_RIGHT 105 | 106 | ;=== Icon & Stye === 107 | BrandingText "PortableApps.com®" 108 | 109 | ;=== Pages 110 | !ifdef COPYLOCALFILES 111 | !define MUI_CUSTOMFUNCTION_ABORT CustomAbortFunction 112 | !endif 113 | !define MUI_LANGDLL_WINDOWTITLE "${PORTABLEAPPNAME}" 114 | !define MUI_LANGDLL_INFO "Please select a language for the installer." 115 | !define MUI_WELCOMEFINISHPAGE_BITMAP "PortableApps.comInstaller.bmp" 116 | !ifdef PLUGINNAME 117 | !define MUI_WELCOMEPAGE_TITLE "${PORTABLEAPPNAMEDOUBLEDAMPERSANDS}" 118 | !else 119 | !define MUI_WELCOMEPAGE_TITLE "${PORTABLEAPPNAMEDOUBLEDAMPERSANDS}" 120 | !endif 121 | !define MUI_WELCOMEPAGE_TEXT "$(welcome)" 122 | !define MUI_PAGE_CUSTOMFUNCTION_PRE PreWelcome 123 | !define MUI_COMPONENTSPAGE_SMALLDESC 124 | !insertmacro MUI_PAGE_WELCOME 125 | !ifdef LICENSEAGREEMENT 126 | ;!define MUI_LICENSEPAGE_CHECKBOX 127 | !define MUI_PAGE_CUSTOMFUNCTION_PRE PreLicense 128 | !define MUI_PAGE_CUSTOMFUNCTION_SHOW ShowLicense 129 | !define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveLicense 130 | !insertmacro MUI_PAGE_LICENSE "..\..\App\AppInfo\${LICENSEAGREEMENT}" 131 | !endif 132 | !ifdef MAINSECTIONTITLE 133 | !define MUI_PAGE_CUSTOMFUNCTION_PRE PreComponents 134 | !insertmacro MUI_PAGE_COMPONENTS 135 | !endif 136 | !define MUI_DIRECTORYPAGE_VERIFYONLEAVE 137 | !define MUI_PAGE_CUSTOMFUNCTION_PRE PreDirectory 138 | !define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveDirectory 139 | !insertmacro MUI_PAGE_DIRECTORY 140 | !define MUI_PAGE_CUSTOMFUNCTION_SHOW ShowInstFiles 141 | !insertmacro MUI_PAGE_INSTFILES 142 | !define MUI_FINISHPAGE_TEXT "$(finish)" 143 | !define MUI_PAGE_CUSTOMFUNCTION_PRE PreFinish 144 | !define MUI_FINISHPAGE_TITLE_3LINES 145 | !define MUI_FINISHPAGE_CANCEL_ENABLED 146 | !ifndef PLUGINNAME 147 | !define MUI_FINISHPAGE_RUN_NOTCHECKED 148 | !define MUI_FINISHPAGE_RUN "$INSTDIR\${FINISHPAGERUN}" 149 | !endif 150 | !insertmacro MUI_PAGE_FINISH 151 | 152 | ;=== Languages 153 | !ifndef INSTALLERMULTILINGUAL 154 | !insertmacro MUI_LANGUAGE "${INSTALLERLANGUAGE}" 155 | !include PortableApps.comInstallerLanguages\${INSTALLERLANGUAGE}.nsh 156 | !else 157 | !tempfile LangAutoDetectFile 158 | !macro IncludeLang _LANG_NAME 159 | ; define and filename are all uppercase but both case insensitive 160 | !ifdef USES_${_LANG_NAME} 161 | !insertmacro MUI_LANGUAGE "${_LANG_NAME}" 162 | !include PortableApps.comInstallerLanguages\${_LANG_NAME}.nsh 163 | !appendfile "${LangAutoDetectFile}" "${Case} ${LANG_${_LANG_NAME}}$\n" 164 | !endif 165 | !macroend 166 | !define IncludeLang "!insertmacro IncludeLang" 167 | 168 | ${IncludeLang} English 169 | ${IncludeLang} EnglishGB 170 | ${IncludeLang} Afrikaans 171 | ${IncludeLang} Albanian 172 | ${IncludeLang} Arabic 173 | ${IncludeLang} Armenian 174 | ${IncludeLang} Basque 175 | ${IncludeLang} Belarusian 176 | ${IncludeLang} Bosnian 177 | ${IncludeLang} Breton 178 | ${IncludeLang} Bulgarian 179 | ${IncludeLang} Catalan 180 | ${IncludeLang} Cibemba 181 | ${IncludeLang} Croatian 182 | ${IncludeLang} Czech 183 | ${IncludeLang} Danish 184 | ${IncludeLang} Dutch 185 | ${IncludeLang} Efik 186 | ${IncludeLang} Esperanto 187 | ${IncludeLang} Estonian 188 | ${IncludeLang} Farsi 189 | ${IncludeLang} Finnish 190 | ${IncludeLang} French 191 | ${IncludeLang} Galician 192 | ${IncludeLang} Georgian 193 | ${IncludeLang} German 194 | ${IncludeLang} Greek 195 | ${IncludeLang} Hebrew 196 | ${IncludeLang} Hungarian 197 | ${IncludeLang} Icelandic 198 | ${IncludeLang} Igbo 199 | ${IncludeLang} Indonesian 200 | ${IncludeLang} Irish 201 | ${IncludeLang} Italian 202 | ${IncludeLang} Japanese 203 | ${IncludeLang} Khmer 204 | ${IncludeLang} Korean 205 | ${IncludeLang} Kurdish 206 | ${IncludeLang} Latvian 207 | ${IncludeLang} Lithuanian 208 | ${IncludeLang} Luxembourgish 209 | ${IncludeLang} Macedonian 210 | ${IncludeLang} Malagasy 211 | ${IncludeLang} Malay 212 | ${IncludeLang} Mongolian 213 | ${IncludeLang} Norwegian 214 | ${IncludeLang} NorwegianNynorsk 215 | ${IncludeLang} Pashto 216 | ${IncludeLang} Polish 217 | ${IncludeLang} Portuguese 218 | ${IncludeLang} PortugueseBR 219 | ${IncludeLang} Romanian 220 | ${IncludeLang} Russian 221 | ${IncludeLang} Serbian 222 | ${IncludeLang} SerbianLatin 223 | ${IncludeLang} SimpChinese 224 | ${IncludeLang} Slovak 225 | ${IncludeLang} Slovenian 226 | ${IncludeLang} Spanish 227 | ${IncludeLang} SpanishInternational 228 | ${IncludeLang} Swahili 229 | ${IncludeLang} Swedish 230 | ${IncludeLang} Thai 231 | ${IncludeLang} TradChinese 232 | ${IncludeLang} Turkish 233 | ${IncludeLang} Ukrainian 234 | ${IncludeLang} Uzbek 235 | ${IncludeLang} Valencia 236 | ${IncludeLang} Vietnamese 237 | ${IncludeLang} Welsh 238 | ${IncludeLang} Yoruba 239 | 240 | !insertmacro MUI_RESERVEFILE_LANGDLL 241 | !endif 242 | 243 | ;=== Macros 244 | !macro !insertmacro1-10 _m 245 | !insertmacro ${_m} 1 246 | !insertmacro ${_m} 2 247 | !insertmacro ${_m} 3 248 | !insertmacro ${_m} 4 249 | !insertmacro ${_m} 5 250 | !insertmacro ${_m} 6 251 | !insertmacro ${_m} 7 252 | !insertmacro ${_m} 8 253 | !insertmacro ${_m} 9 254 | !insertmacro ${_m} 10 255 | !macroend 256 | !define !insertmacro1-10 "!insertmacro !insertmacro1-10" 257 | 258 | ;=== Variables 259 | Var FOUNDPORTABLEAPPSPATH 260 | !ifdef MAINSECTIONTITLE 261 | Var OPTIONAL1DONE 262 | !endif 263 | Var AUTOMATEDINSTALL 264 | Var AUTOCLOSE 265 | Var SILENTLANGUAGEMODE 266 | Var HIDEINSTALLER 267 | Var MINIMIZEINSTALLER 268 | !ifdef LICENSEAGREEMENT 269 | Var EULAVERSIONMATCH 270 | !endif 271 | !ifdef COPYLOCALFILES 272 | Var CopyLocalFilesFrom 273 | Var CopyLocalFilesTo 274 | Var MISSINGFILEORPATH 275 | !endif 276 | !ifdef DOWNLOADURL 277 | Var MD5MISMATCH 278 | Var DOWNLOADRESULT 279 | Var DOWNLOADEDFILE 280 | Var DOWNLOADALREADYEXISTED 281 | Var SECONDDOWNLOADATTEMPT 282 | Var DownloadURLActual 283 | !endif 284 | Var INTERNALEULAVERSION 285 | Var InstallingStatusString 286 | Var bolAppUpgrade 287 | Var bolLogFile 288 | 289 | ;=== Custom Code 290 | !ifdef USESCUSTOMCODE 291 | !if ${__FILE__} == "PortableApps.comInstallerPlugin.nsi" 292 | !include PortableApps.comInstallerPluginCustom.nsh 293 | !else 294 | !include PortableApps.comInstallerCustom.nsh 295 | !endif 296 | !endif 297 | 298 | !ifdef INSTALLERMULTILINGUAL 299 | !macro CaseLang _LANG_NAME _LANG_ID 300 | !ifdef USES_${_LANG_NAME} 301 | ${Case} ${_LANG_ID} 302 | !endif 303 | !macroend 304 | !define CaseLang "!insertmacro CaseLang" 305 | !endif 306 | 307 | Function .onInit 308 | SetSilent normal 309 | 310 | !ifdef DownloadURL 311 | StrCpy $R0 $EXEFILE "" -15 312 | ${If} $R0 != "_online.paf.exe" 313 | ${AndIf} $R0 != "line.paf[1].exe" ;Handle IE's renaming of files when run directly from a download 314 | ${AndIf} $R0 != "line.paf[2].exe" 315 | ${AndIf} $R0 != "line.paf[3].exe" 316 | ${AndIf} $R0 != "line.paf[4].exe" 317 | ${AndIf} $R0 != "line.paf[5].exe" 318 | ${AndIf} $R0 != "line.paf[6].exe" 319 | ${AndIf} $R0 != "line.paf[7].exe" 320 | ${AndIf} $R0 != "line.paf[8].exe" 321 | ${AndIf} $R0 != "line.paf[9].exe" 322 | MessageBox MB_OK|MB_ICONSTOP `PortableApps.com Installers that download files must end with "_online.paf.exe". This is to ensure that users always know that an installer downloads files before it is run. Please rename the file to end in _online.paf.exe before running.` 323 | Abort 324 | ${EndIf} 325 | !endif 326 | 327 | InitPluginsDir 328 | 329 | !ifdef INSTALLERMULTILINGUAL 330 | ReadEnvStr $0 "PortableApps.comLocaleID" 331 | ${Switch} $0 332 | ; Use the Case statements formed earlier. 333 | !include "${LangAutoDetectFile}" 334 | !delfile "${LangAutoDetectFile}" 335 | !undef LangAutoDetectFile 336 | StrCpy $LANGUAGE $0 337 | ${Break} 338 | ${Default} 339 | !insertmacro MUI_LANGDLL_DISPLAY 340 | ${EndSwitch} 341 | !endif 342 | 343 | ;=== Check for logging mode 344 | ${GetOptions} $CMDLINE "/LOG=" $0 345 | 346 | ${IfNot} ${Errors} 347 | ${AndIf} $0 == "true" 348 | StrCpy $bolLogFile true 349 | ${Else} 350 | ClearErrors 351 | ${EndIf} 352 | 353 | ;=== Check for a specified installation directory 354 | ${GetOptions} $CMDLINE "/DESTINATION=" $0 355 | 356 | ${IfNot} ${Errors} 357 | !ifdef COMMONFILESPLUGIN 358 | StrCpy $INSTDIR "$0CommonFiles\${APPID}" 359 | !else 360 | ${GetOptions} $CMDLINE "/COPYNUMBER=" $1 361 | ${IfNot} ${Errors} 362 | StrCpy $INSTDIR "$0${APPID}_Copy_$1" 363 | ${Else} 364 | StrCpy $INSTDIR "$0${APPID}" 365 | ${EndIf} 366 | !endif 367 | 368 | !ifdef LICENSEAGREEMENT 369 | !ifndef EULAVERSION 370 | StrCpy $INTERNALEULAVERSION "1" 371 | !else 372 | StrCpy $INTERNALEULAVERSION ${EULAVERSION} 373 | !endif 374 | ${If} ${FileExists} "$INSTDIR\Data\PortableApps.comInstaller\license.ini" 375 | ReadINIStr $0 "$INSTDIR\Data\PortableApps.comInstaller\license.ini" "PortableApps.comInstaller" "EULAVersion" 376 | ClearErrors 377 | ${If} $0 == $INTERNALEULAVERSION 378 | StrCpy $EULAVERSIONMATCH "true" 379 | ${EndIf} 380 | ${EndIf} 381 | !endif 382 | 383 | ;=== Check for PortableApps.com Platform 384 | ${GetParent} $INSTDIR $0 385 | !ifdef COMMONFILESPLUGIN 386 | ${GetParent} $0 $0 387 | !endif 388 | 389 | ;=== Check that it exists at the right location 390 | DetailPrint '$(checkforplatform)' 391 | 392 | ${If} ${FileExists} `$0\PortableApps.com\PortableAppsPlatform.exe` 393 | ;=== Check that it's the real deal 394 | MoreInfo::GetProductName `$0\PortableApps.com\PortableAppsPlatform.exe` 395 | Pop $1 396 | ${If} $1 == "PortableApps.com Platform" 397 | MoreInfo::GetCompanyName `$0\PortableApps.com\PortableAppsPlatform.exe` 398 | Pop $1 399 | ${If} $1 == "PortableApps.com" 400 | ;=== Check that it's running 401 | FindProcDLL::FindProc "PortableAppsPlatform.exe" 402 | ${If} $R0 == 1 403 | ;=== Do a partially automated install 404 | StrCpy $AUTOMATEDINSTALL "true" 405 | 406 | ClearErrors 407 | ${GetOptions} $CMDLINE "/AUTOCLOSE=" $R0 408 | ${IfNot} ${Errors} 409 | ${AndIf} $R0 == "true" 410 | StrCpy $AUTOCLOSE "true" 411 | ${EndIf} 412 | 413 | ClearErrors 414 | ${GetOptions} $CMDLINE "/HIDEINSTALLER=" $R0 415 | ${IfNot} ${Errors} 416 | ${AndIf} $R0 == "true" 417 | StrCpy $HIDEINSTALLER "true" 418 | ${EndIf} 419 | 420 | ClearErrors 421 | ${GetOptions} $CMDLINE "/MINIMIZEINSTALLER=" $R0 422 | ${IfNot} ${Errors} 423 | ${AndIf} $R0 == "true" 424 | StrCpy $MINIMIZEINSTALLER "true" 425 | ${EndIf} 426 | 427 | ClearErrors 428 | ${GetOptions} $CMDLINE "/SILENT=" $R0 429 | ${IfNot} ${Errors} 430 | ${AndIf} $R0 == "true" 431 | ;Duplicate of the size calculation code, to be functionalized later 432 | SectionGetSize ${MAINSECTIONIDX} $1 ;=== Space Required for App 433 | !ifdef MAINSECTIONTITLE 434 | SectionGetFlags ${OPTIONALSECTIONIDX} $9 435 | IntOp $9 $9 & ${SF_SELECTED} 436 | ${If} $9 >= ${SF_SELECTED} 437 | SectionGetSize ${OPTIONALSECTIONIDX} $2 ;=== Space Required for App 438 | IntOp $1 $1 + $2 439 | ${EndIf} 440 | !endif 441 | ${GetRoot} $INSTDIR $2 442 | ${DriveSpace} `$2\` "/D=F /S=M" $3 ;=== Space Free on Device 443 | 444 | IntOp $1 $1 / 1024 445 | 446 | ${If} $3 <= $1 447 | IntOp $1 $1 * 1024 448 | IntOp $3 $3 * 1024 449 | !ifndef PLUGININSTALLER ;=== If not a plugin installer, add the current install size to free space 450 | ${If} ${FileExists} $INSTDIR 451 | ${GetSize} `$INSTDIR` "/M=*.* /S=0K /G=0" $4 $5 $6 ;=== Current installation size 452 | IntOp $3 $3 + $4 ;=== Space Free + Current Root Install Size 453 | ${GetSize} `$INSTDIR\App` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Current installation size 454 | IntOp $3 $3 + $4 ;=== Space Free + Current App Install Size 455 | ${GetSize} `$INSTDIR\Other` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Current installation size 456 | IntOp $3 $3 + $4 ;=== Space Free + Current Other Install Size 457 | 458 | ${If} `${ADDONSDIRECTORYPRESERVE}` != "NONE" 459 | ${AndIf} ${FileExists} `$INSTDIR\${ADDONSDIRECTORYPRESERVE}` 460 | ${GetSize} `$INSTDIR\${ADDONSDIRECTORYPRESERVE}` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Size of Data directory 461 | IntOp $3 $3 - $4 ;=== Remove the plugins directory from the free space calculation 462 | ${EndIf} 463 | ${EndIf} 464 | !else 465 | !ifdef COMMONFILESPLUGIN ;Duplicate code for now, to do above for CommonFiles as well 466 | ${If} ${FileExists} $INSTDIR 467 | ${GetSize} `$INSTDIR` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Current installation size 468 | IntOp $3 $3 + $4 ;=== Space Free + Current Install Size 469 | ${EndIf} 470 | !endif 471 | !endif 472 | ${If} $3 <= $1 473 | MessageBox MB_OK|MB_ICONEXCLAMATION $(notenoughspace) 474 | Abort 475 | ${EndIf} 476 | ${EndIf} 477 | 478 | !ifdef LICENSEAGREEMENT 479 | ${If} $EULAVERSIONMATCH == "true" 480 | SetSilent silent 481 | ${EndIf} 482 | !else 483 | SetSilent silent 484 | !endif 485 | ${EndIf} 486 | 487 | ClearErrors 488 | ${GetOptions} $CMDLINE "/SILENTLANGUAGEMODE=" $R0 489 | ${IfNot} ${Errors} 490 | ${If} $R0 == "auto" 491 | ${OrIf} $R0 == "never" 492 | ${OrIf} $R0 == "always" 493 | StrCpy $SILENTLANGUAGEMODE $R0 494 | ${Else} 495 | StrCpy $SILENTLANGUAGEMODE "auto" 496 | ${EndIf} 497 | ${Else} 498 | StrCpy $SILENTLANGUAGEMODE "auto" 499 | ${EndIf} 500 | 501 | ${EndIf} 502 | ${EndIf} 503 | ${EndIf} 504 | ${EndIf} 505 | ${Else} 506 | ClearErrors 507 | ;=== Check legacy location 508 | ${GetOptions} $CMDLINE "-o" $R0 509 | ${IfNot} ${Errors} 510 | !ifdef COMMONFILESPLUGIN 511 | StrCpy $INSTDIR "$R0CommonFiles\${APPID}" 512 | !else 513 | StrCpy $INSTDIR "$R0${APPID}" 514 | !endif 515 | ${Else} 516 | ;=== No installation directory found 517 | ClearErrors 518 | ${If} ${FileExists} "$PROFILE\PortableApps\*.*" 519 | StrCpy $FOUNDPORTABLEAPPSPATH "$Profile\PortableApps" 520 | ${Else} 521 | ${GetDrives} "HDD+FDD" GetDrivesCallBack 522 | ${EndIf} 523 | ${If} $FOUNDPORTABLEAPPSPATH != "" 524 | !ifdef COMMONFILESPLUGIN 525 | StrCpy $INSTDIR "$FOUNDPORTABLEAPPSPATH\CommonFiles\${APPID}" 526 | !else 527 | StrCpy $INSTDIR "$FOUNDPORTABLEAPPSPATH\${APPID}" 528 | !endif 529 | ${Else} 530 | !ifdef COMMONFILESPLUGIN 531 | StrCpy $INSTDIR "$EXEDIR\CommonFiles\${APPID}" 532 | !else 533 | StrCpy $INSTDIR "$EXEDIR\${APPID}" 534 | !endif 535 | ${EndIf} 536 | ${EndIf} 537 | ${EndIf} 538 | 539 | !ifdef MAINSECTIONTITLE 540 | !ifdef OPTIONALSECTIONPRESELECTEDIFNONENGLISHINSTALL 541 | ;=== If it's not English, select the optional component (languages) by default 542 | ${IfThen} $LANGUAGE != 1033 ${|} SectionSetFlags 1 ${OPTIONALSECTIONIDX} ${|} 543 | !endif 544 | ${If} ${Silent} 545 | ${If} "${OPTIONALSECTIONINSTALLEDWHENSILENT}" == "true" 546 | SectionSetFlags 1 ${OPTIONALSECTIONIDX} 547 | ${ElseIf} "${OptionalSectionSelectedInstallType}" == "Multilingual" 548 | ${If} $SILENTLANGUAGEMODE != "never" 549 | ${If} $SILENTLANGUAGEMODE == "always" 550 | SectionSetFlags 1 ${OPTIONALSECTIONIDX} 551 | ${Else} 552 | ${IfThen} $LANGUAGE != 1033 ${|} SectionSetFlags 1 ${OPTIONALSECTIONIDX} ${|} 553 | ${EndIf} 554 | ${EndIf} 555 | ${EndIf} 556 | ${EndIf} 557 | 558 | !endif 559 | 560 | !ifdef COPYLOCALFILES 561 | StrCpy $CopyLocalFilesFrom "" 562 | 563 | ${If} "${CopyFromRegPath}" != "" 564 | ${registry::Read} "${CopyFromRegPath}" "${CopyFromRegKey}" $R0 $R1 565 | ${If} $R0 != "" 566 | ;Strip trailing slash if there 567 | StrCpy $1 $R0 "" -1 568 | ${If} $1 == "\" 569 | StrCpy $R0 $R0 -1 570 | ${EndIf} 571 | 572 | ;Go up directories if needed 573 | ${If} "${CopyFromRegRemoveDirectories}" != "" 574 | StrCpy $1 1 575 | ${Do} 576 | ${GetParent} $R0 $R0 577 | IntOp $1 $1 + 1 578 | ${LoopUntil} $1 > "${CopyFromRegRemoveDirectories}" 579 | ${EndIf} 580 | 581 | ;Check for existence 582 | ${If} ${FileExists} "$R0\*.*" 583 | StrCpy $CopyLocalFilesFrom $R0 584 | ${EndIf} 585 | ${EndIf} 586 | ${EndIf} 587 | 588 | ;Fallback to direct entry 589 | ${If} $CopyLocalFilesFrom == "" 590 | ${AndIf} "${CopyFromDirectory}" != "" 591 | StrCpy $CopyLocalFilesFrom "${CopyFromDirectory}" 592 | ${WordReplace} $CopyLocalFilesFrom "%PROGRAMFILES%" $PROGRAMFILES + $CopyLocalFilesFrom 593 | ${WordReplace} $CopyLocalFilesFrom "%PROGRAMFILES32%" $PROGRAMFILES32 + $CopyLocalFilesFrom 594 | ${WordReplace} $CopyLocalFilesFrom "%PROGRAMFILES64%" $PROGRAMFILES64 + $CopyLocalFilesFrom 595 | ${WordReplace} $CopyLocalFilesFrom "%COMMONFILES%" $COMMONFILES + $CopyLocalFilesFrom 596 | ${WordReplace} $CopyLocalFilesFrom "%COMMONFILES32%" $COMMONFILES32 + $CopyLocalFilesFrom 597 | ${WordReplace} $CopyLocalFilesFrom "%COMMONFILES64%" $COMMONFILES64 + $CopyLocalFilesFrom 598 | ${WordReplace} $CopyLocalFilesFrom "%DESKTOP%" $DESKTOP + $CopyLocalFilesFrom 599 | ${WordReplace} $CopyLocalFilesFrom "%WINDIR%" $WINDIR + $CopyLocalFilesFrom 600 | ${WordReplace} $CopyLocalFilesFrom "%SYSDIR%" $SYSDIR + $CopyLocalFilesFrom 601 | ${WordReplace} $CopyLocalFilesFrom "%APPDATA%" $APPDATA + $CopyLocalFilesFrom 602 | ${WordReplace} $CopyLocalFilesFrom "%LOCALAPPDATA%" $LOCALAPPDATA + $CopyLocalFilesFrom 603 | ${WordReplace} $CopyLocalFilesFrom "%TEMP%" $TEMP + $CopyLocalFilesFrom 604 | ${EndIf} 605 | ${If} ${FileExists} "$CopyLocalFilesFrom\*.*" 606 | SectionGetSize ${MAINSECTIONIDX} $0 607 | ${GetSize} $CopyLocalFilesFrom "/M=*.* /S=0K /G=1" $1 $2 $3 608 | IntOp $0 $0 + $1 609 | SectionSetSize ${MAINSECTIONIDX} $0 610 | ${EndIf} 611 | !endif 612 | !ifdef AdditionalInstallSize 613 | SectionGetSize ${MAINSECTIONIDX} $0 614 | IntOp $0 $0 + ${AdditionalInstallSize} 615 | SectionSetSize ${MAINSECTIONIDX} $0 616 | !endif 617 | 618 | ${If} "${CHECKRUNNING}" != "NONE" 619 | ;=== Check if app is running? 620 | RunningTryAgain: 621 | FindProcDLL::FindProc "${CHECKRUNNING}" 622 | ${If} $R0 == 1 623 | MessageBox MB_OKCANCEL|MB_ICONINFORMATION $(runwarning) IDOK RunningTryAgain IDCANCEL RunningCancel 624 | 625 | RunningCancel: 626 | Abort 627 | ${EndIf} 628 | ${EndIf} 629 | FunctionEnd 630 | 631 | Function PreWelcome 632 | ${IfThen} $AUTOMATEDINSTALL == "true" ${|} Abort ${|} 633 | FunctionEnd 634 | 635 | !ifdef LICENSEAGREEMENT 636 | Function PreLicense 637 | ${If} $AUTOMATEDINSTALL == "true" 638 | ${AndIf} $EULAVERSIONMATCH == "true" 639 | Abort 640 | ${EndIf} 641 | 642 | !ifndef EULAVERSION 643 | StrCpy $INTERNALEULAVERSION "1" 644 | !else 645 | StrCpy $INTERNALEULAVERSION "${EULAVERSION}" 646 | !endif 647 | ${If} ${FileExists} "$INSTDIR\Data\PortableApps.comInstaller\license.ini" 648 | ReadINIStr $0 "$INSTDIR\Data\PortableApps.comInstaller\license.ini" "PortableApps.comInstaller" "EULAVersion" 649 | ClearErrors 650 | ${If} $0 == $INTERNALEULAVERSION 651 | ${AndIf} $AUTOMATEDINSTALL == "true" 652 | Abort 653 | ${EndIf} 654 | ${EndIf} 655 | FunctionEnd 656 | Function ShowLicense 657 | ${If} $AUTOMATEDINSTALL == "true" 658 | ${TBProgress} 20 659 | ${TBProgress_State} Paused 660 | ${EndIf} 661 | FunctionEnd 662 | Function LeaveLicense 663 | ${If} $AUTOMATEDINSTALL == "true" 664 | ${TBProgress_State} NoProgress 665 | ${EndIf} 666 | FunctionEnd 667 | !endif 668 | 669 | Function ShowInstFiles 670 | w7tbp::Start 671 | FunctionEnd 672 | 673 | !ifdef MAINSECTIONTITLE 674 | Function PreComponents 675 | ${If} $AUTOCLOSE != "true" 676 | ${OrIfNot} ${FileExists} "$INSTDIR\App\AppInfo\appinfo.ini" 677 | Return 678 | ${EndIf} 679 | 680 | ReadINIStr $0 "$INSTDIR\App\AppInfo\appinfo.ini" "Details" "InstallType" 681 | ClearErrors 682 | ${If} $0 == "${OPTIONALSECTIONSELECTEDINSTALLTYPE}" 683 | SectionSetFlags 1 ${OPTIONALSECTIONIDX} 684 | Abort 685 | ${EndIf} 686 | 687 | ;=== Check not selected 688 | ${If} $0 == "${OPTIONALSECTIONNOTSELECTEDINSTALLTYPE}" 689 | SectionSetFlags 0 ${OPTIONALSECTIONIDX} 690 | Abort 691 | ${EndIf} 692 | FunctionEnd 693 | !endif 694 | 695 | Function PreDirectory 696 | ${IfThen} $AUTOMATEDINSTALL != "true" ${|} Return ${|} 697 | 698 | SectionGetSize ${MAINSECTIONIDX} $1 ;=== Space Required for App 699 | !ifdef MAINSECTIONTITLE 700 | SectionGetFlags ${OPTIONALSECTIONIDX} $9 701 | IntOp $9 $9 & ${SF_SELECTED} 702 | ${If} $9 >= ${SF_SELECTED} 703 | SectionGetSize ${OPTIONALSECTIONIDX} $2 ;=== Space Required for App 704 | IntOp $1 $1 + $2 705 | ${EndIf} 706 | !endif 707 | ${GetRoot} $INSTDIR $2 708 | ${DriveSpace} `$2\` "/D=F /S=M" $3 ;=== Space Free on Device 709 | 710 | IntOp $1 $1 / 1024 711 | 712 | ${If} $3 <= $1 713 | IntOp $1 $1 * 1024 714 | IntOp $3 $3 * 1024 715 | 716 | !ifndef PLUGININSTALLER ;=== If not a plugin installer, add the current install size to free space 717 | ${If} ${FileExists} $INSTDIR 718 | ${GetSize} $INSTDIR "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Current installation size 719 | IntOp $3 $3 + $4 ;=== Space Free + Current Install Size 720 | 721 | ${If} ${FileExists} `$INSTDIR\Data` 722 | ${GetSize} `$INSTDIR\Data` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Size of Data directory 723 | IntOp $3 $3 - $4 ;=== Remove the data directory from the free space calculation 724 | ${EndIf} 725 | 726 | ${If} `${ADDONSDIRECTORYPRESERVE}` != "NONE" 727 | ${AndIf} ${FileExists} `$INSTDIR\${ADDONSDIRECTORYPRESERVE}` 728 | ${GetSize} `$INSTDIR\${ADDONSDIRECTORYPRESERVE}` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Size of Data directory 729 | IntOp $3 $3 - $4 ;=== Remove the plugins directory from the free space calculation 730 | ${EndIf} 731 | ${EndIf} 732 | !else 733 | !ifdef COMMONFILESPLUGIN ;Duplicate code for now, to do above for CommonFiles as well 734 | ${If} ${FileExists} $INSTDIR 735 | ${GetSize} `$INSTDIR` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Current installation size 736 | IntOp $3 $3 + $4 ;=== Space Free + Current Install Size 737 | ${EndIf} 738 | !endif 739 | !endif 740 | 741 | ${If} $3 <= $1 742 | MessageBox MB_OK|MB_ICONEXCLAMATION "$(notenoughspace)" 743 | Return 744 | ${EndIf} 745 | ${EndIf} 746 | 747 | ;=== Check if app is running? 748 | ${IfThen} "${CHECKRUNNING}" == "NONE" ${|} Abort ${|} 749 | FindProcDLL::FindProc "${CHECKRUNNING}" 750 | ${IfThen} $R0 != "1" ${|} Abort ${|} 751 | MessageBox MB_OK|MB_ICONINFORMATION $(runwarning) 752 | FunctionEnd 753 | 754 | Function LeaveDirectory 755 | GetInstDirError $0 756 | 757 | ;=== Does it already exist? (upgrade) 758 | ${If} ${FileExists} $INSTDIR 759 | ${AndIf} "${CHECKRUNNING}" != "NONE" 760 | ;=== Check if app is running? 761 | FindProcDLL::FindProc "${CHECKRUNNING}" 762 | ${If} $R0 = 1 763 | MessageBox MB_OK|MB_ICONINFORMATION $(runwarning) 764 | Abort 765 | ${EndIf} 766 | ${EndIf} 767 | 768 | ; 0 is valid, enough space, all fine 769 | ${Select} $0 770 | ${Case} 1 771 | MessageBox MB_OK|MB_ICONINFORMATION $(invaliddirectory) 772 | Abort 773 | 774 | ${Case} 2 775 | ${IfNot} ${FileExists} $INSTDIR ;=== Is upgrade 776 | MessageBox MB_OK|MB_ICONEXCLAMATION $(notenoughspace) 777 | Abort 778 | ${EndIf} 779 | 780 | SectionGetSize ${MAINSECTIONIDX} $1 ;=== Space Required for App 781 | !ifdef MAINSECTIONTITLE 782 | SectionGetFlags ${OPTIONALSECTIONIDX} $9 783 | IntOp $9 $9 & ${SF_SELECTED} 784 | ${If} $9 >= ${SF_SELECTED} 785 | SectionGetSize ${OPTIONALSECTIONIDX} $2 ;=== Space Required for App 786 | IntOp $1 $1 + $2 787 | ${EndIf} 788 | !endif 789 | ${GetRoot} $INSTDIR $2 790 | ${DriveSpace} `$2\` "/D=F /S=K" $3 ;=== Space Free on Device 791 | 792 | 793 | !ifndef PLUGININSTALLER ;=== If not a plugin installer, add the current install size to free space 794 | ${GetSize} `$INSTDIR` "/M=*.* /S=0K /G=0" $4 $5 $6 ;=== Current installation size 795 | IntOp $3 $3 + $4 ;=== Space Free + Current Root Install Size 796 | ${GetSize} `$INSTDIR\App` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Current installation size 797 | IntOp $3 $3 + $4 ;=== Space Free + Current App Install Size 798 | ${GetSize} `$INSTDIR\Other` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Current installation size 799 | IntOp $3 $3 + $4 ;=== Space Free + Current Other Install Size 800 | 801 | ${If} `${ADDONSDIRECTORYPRESERVE}` != "NONE" 802 | ${AndIf} ${FileExists} `$INSTDIR\${ADDONSDIRECTORYPRESERVE}` 803 | ${GetSize} `$INSTDIR\${ADDONSDIRECTORYPRESERVE}` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Size of Data directory 804 | IntOp $3 $3 - $4 ;=== Remove the plugins directory from the free space calculation 805 | ${EndIf} 806 | !else 807 | !ifdef COMMONFILESPLUGIN ;Duplicate code for now, to do above for CommonFiles as well 808 | ${GetSize} `$INSTDIR` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Current installation size 809 | IntOp $3 $3 + $4 ;=== Space Free + Current Install Size 810 | !endif 811 | !endif 812 | 813 | ${If} $3 <= $1 814 | MessageBox MB_OK|MB_ICONEXCLAMATION "$(notenoughspace)" 815 | Abort 816 | ${EndIf} 817 | ${EndSelect} 818 | 819 | ;Check for Program Files 820 | ReadEnvStr $0 IPromiseNotToComplainWhenPortableAppsDontWorkRightInProgramFiles 821 | ${If} $0 != "I understand that this may not work and that I can not ask for help with any of my apps when operating in this fashion." 822 | ${WordFind} "$INSTDIR\" "$PROGRAMFILES\" "*" $R0 823 | ${If} $R0 > 0 824 | MessageBox MB_OK|MB_ICONINFORMATION "$(invaliddirectory) [$PROGRAMFILES or sub-directories]" 825 | Abort 826 | ${EndIf} 827 | ${WordFind} "$INSTDIR\" "$PROGRAMFILES64\" "*" $R0 828 | ${If} $R0 > 0 829 | MessageBox MB_OK|MB_ICONINFORMATION "$(invaliddirectory) [$PROGRAMFILES64 or sub-directories]" 830 | Abort 831 | ${EndIf} 832 | ${EndIf} 833 | FunctionEnd 834 | 835 | Function PreFinish 836 | ${IfThen} $AUTOCLOSE == "true" ${|} Abort ${|} 837 | FunctionEnd 838 | 839 | Function GetDrivesCallBack 840 | ;=== Skip usual floppy letters 841 | ${If} $8 == "FDD" 842 | ${If} $9 == "A:\" 843 | ${OrIf} $9 == "B:\" 844 | Push $0 845 | Return 846 | ${EndIf} 847 | ${EndIf} 848 | 849 | ${If} ${FileExists} $9PortableApps 850 | StrCpy $FOUNDPORTABLEAPPSPATH $9PortableApps 851 | ${EndIf} 852 | 853 | Push $0 854 | FunctionEnd 855 | 856 | !ifdef MAINSECTIONTITLE 857 | Section "${MAINSECTIONTITLE}" 858 | !else 859 | Section "App Portable (required)" 860 | !endif 861 | 862 | ${If} $MINIMIZEINSTALLER == "true" 863 | ShowWindow $HWNDPARENT ${SW_MINIMIZE} 864 | ${EndIf} 865 | ${If} $HIDEINSTALLER == "true" 866 | ShowWindow $HWNDPARENT ${SW_HIDE} 867 | ${EndIf} 868 | 869 | ${If} ${FileExists} "$INSTDIR\*.*" 870 | StrCpy $bolAppUpgrade true 871 | ${EndIf} 872 | 873 | ${If} $(installingstatus) != "" 874 | StrCpy $InstallingStatusString "$(installingstatus)" 875 | ${Else} 876 | StrCpy $InstallingStatusString "$(MUI_TEXT_INSTALLING_TITLE)" 877 | ${EndIf} 878 | 879 | SectionIn RO 880 | SetOutPath $INSTDIR 881 | 882 | ${If} $bolAppUpgrade == true 883 | ${If} $(prepareupgrade) == "" 884 | DetailPrint $InstallingStatusString 885 | ${Else} 886 | DetailPrint $(prepareupgrade) 887 | ${EndIf} 888 | ${Else} 889 | DetailPrint $InstallingStatusString 890 | ${EndIf} 891 | SetDetailsPrint ListOnly 892 | 893 | ;=== Download Files 894 | !ifdef DownloadURL 895 | ${If} ${FileExists} `$EXEDIR\${DownloadFileName}` 896 | !ifdef DownloadMD5 897 | md5dll::GetMD5File "$EXEDIR\${DownloadFileName}" 898 | Pop $R0 899 | ${If} $R0 == ${DownloadMD5} 900 | StrCpy $DOWNLOADALREADYEXISTED "true" 901 | StrCpy $DOWNLOADRESULT "OK" 902 | ${EndIf} 903 | !else 904 | StrCpy $DOWNLOADALREADYEXISTED "true" 905 | StrCpy $DOWNLOADRESULT "OK" 906 | !endif 907 | ${EndIf} 908 | 909 | ${If} $DOWNLOADALREADYEXISTED == "true" 910 | StrCpy $DOWNLOADEDFILE "$EXEDIR\${DownloadFileName}" 911 | ${Else} 912 | StrCpy $DownloadURLActual ${DownloadURL} 913 | DownloadTheFile: 914 | CreateDirectory `$PLUGINSDIR\Downloaded` 915 | SetDetailsPrint both 916 | ${If} $(downloading) != "" 917 | DetailPrint $(downloading) 918 | ${Else} 919 | DetailPrint "Downloading ${DownloadName}..." 920 | ${EndIf} 921 | 922 | SetDetailsPrint none 923 | Delete "$PLUGINSDIR\Downloaded\${DownloadName}" 924 | Delete "$PLUGINSDIR\Downloaded\${DownloadFilename}" 925 | 926 | ${If} $(downloading) != "" 927 | inetc::get /CONNECTTIMEOUT 30 /NOCOOKIES /TRANSLATE $(downloading) $(downloadconnecting) $(downloadsecond) $(downloadminute) $(downloadhour) $(downloadplural) "%dkB (%d%%) of %dkB @ %d.%01dkB/s" " (%d %s%s $(downloadremaining))" "$DownloadURLActual" "$PLUGINSDIR\Downloaded\${DownloadName}" /END 928 | ${Else} 929 | inetc::get /CONNECTTIMEOUT 30 /NOCOOKIES /TRANSLATE "Downloading %s..." "Connecting..." second minute hour s "%dkB (%d%%) of %dkB @ %d.%01dkB/s" " (%d %s%s remaining)" "$DownloadURLActual" "$PLUGINSDIR\Downloaded\${DownloadName}" /END 930 | ${EndIf} 931 | SetDetailsPrint both 932 | DetailPrint $InstallingStatusString 933 | SetDetailsPrint ListOnly 934 | Pop $DOWNLOADRESULT 935 | ${If} $DOWNLOADRESULT == "OK" 936 | Rename "$PLUGINSDIR\Downloaded\${DownloadName}" "$PLUGINSDIR\Downloaded\${DownloadFilename}" 937 | StrCpy $DOWNLOADEDFILE "$PLUGINSDIR\Downloaded\${DownloadFilename}" 938 | !ifdef DownloadMD5 939 | md5dll::GetMD5File "$DOWNLOADEDFILE" 940 | Pop $R0 941 | ${If} $R0 != ${DownloadMD5} 942 | ${If} $SECONDDOWNLOADATTEMPT != true 943 | StrCpy $SECONDDOWNLOADATTEMPT true 944 | Goto DownloadTheFile 945 | ${EndIf} 946 | StrCpy $MD5MISMATCH "true" 947 | 948 | Delete "$INTERNET_CACHE\${DownloadFileName}" 949 | Delete "$PLUGINSDIR\Downloaded\${DownloadFilename}" 950 | SetDetailsPrint textonly 951 | DetailPrint "" 952 | SetDetailsPrint listonly 953 | ${TBProgress_State} Error 954 | ${If} $(downloadfilemismatch) != "" 955 | MessageBox MB_OK|MB_ICONEXCLAMATION $(downloadfilemismatch) 956 | DetailPrint $(downloadfilemismatch) 957 | ${Else} 958 | MessageBox MB_OK|MB_ICONEXCLAMATION `The downloaded copy of ${DownloadName} is not valid and can not be installed. Please try installing again.` 959 | DetailPrint `The downloaded copy of ${DownloadName} is not valid and can not be installed. Please try installing again.` 960 | ${EndIf} 961 | ${TBProgress_State} NoProgress 962 | Abort 963 | ${EndIf} 964 | !endif 965 | ${Else} 966 | Delete "$INTERNET_CACHE\${DownloadFileName}" 967 | Delete "$PLUGINSDIR\Downloaded\${DownloadFilename}" 968 | StrCpy $0 $DownloadURLActual 969 | 970 | ;Use backup PA.c download server if necessary 971 | ${WordFind} "$DownloadURLActual" "http://download2.portableapps.com" "#" $R0 972 | ${If} $R0 == 1 973 | ${WordReplace} "$DownloadURLActual" "http://download2.portableapps.com" "http://download.portableapps.com" "+" $DownloadURLActual 974 | Goto DownloadTheFile 975 | ${EndIf} 976 | 977 | ${If} $SECONDDOWNLOADATTEMPT != true 978 | ${AndIf} $DOWNLOADRESULT != "Cancelled" 979 | StrCpy $SECONDDOWNLOADATTEMPT true 980 | Goto DownloadTheFile 981 | ${EndIf} 982 | SetDetailsPrint textonly 983 | DetailPrint "" 984 | SetDetailsPrint listonly 985 | ${TBProgress_State} Error 986 | ${If} $(downloadfailed) != "" 987 | MessageBox MB_OK|MB_ICONEXCLAMATION $(downloadfailed) 988 | DetailPrint $(downloadfailed) 989 | ${Else} 990 | MessageBox MB_OK|MB_ICONEXCLAMATION `The installer was unable to download ${DownloadName}. The installation of the portable app will be incomplete without it. Please try installing again. (ERROR: $DOWNLOADRESULT)` 991 | DetailPrint `The installer was unable to download ${DownloadName}. The installation of the portable app will be incomplete without it. Please try installing again. (ERROR: $DOWNLOADRESULT)` 992 | ${EndIf} 993 | ${TBProgress_State} NoProgress 994 | Abort 995 | ${EndIf} 996 | ${EndIf} 997 | !endif 998 | 999 | !ifdef MAINSECTIONTITLE 1000 | SectionGetFlags 1 $0 1001 | IntOp $0 $0 & ${SF_SELECTED} 1002 | ${If} $0 != ${SF_SELECTED} 1003 | ;=== BEGIN: OPTIONAL NOT SELECTED CLEANUP CODE === 1004 | ;This will be executed before install if the optional section (additional languages, etc) is not selected 1005 | !ifmacrodef CustomCodeOptionalCleanup 1006 | !insertmacro CustomCodeOptionalCleanup 1007 | !endif 1008 | ;=== END: OPTIONAL NOT SELECTED CLEANUP CODE === 1009 | ${EndIf} 1010 | !endif 1011 | 1012 | ;=== BEGIN: PRE-INSTALL CODE === 1013 | ;This will be executed before the app is installed. Useful for cleaning up files no longer used. 1014 | !ifmacrodef CustomCodePreInstall 1015 | !insertmacro CustomCodePreInstall 1016 | !endif 1017 | ;=== END: PRE-INSTALL CODE === 1018 | 1019 | ;=== Remove specific files 1020 | !macro RemoveFile _n 1021 | !ifdef REMOVEFILE${_n} 1022 | Delete `$INSTDIR\${REMOVEFILE${_n}}` 1023 | !endif 1024 | !macroend 1025 | ${!insertmacro1-10} RemoveFile 1026 | 1027 | ;=== Rename the preserved files so they're not deleted in the next part 1028 | !macro PreserveFilePre _n 1029 | !ifdef PRESERVEFILE${_n} 1030 | ${GetFileName} `$INSTDIR\${PRESERVEFILE${_n}}` $1 1031 | ${GetParent} `$INSTDIR\${PRESERVEFILE${_n}}` $2 1032 | CreateDirectory `$INSTDIR\~PRESERVEFILE${_n}` 1033 | ${MoveFiles} DOS $1 $2 `$INSTDIR\~PRESERVEFILE${_n}` 1034 | !endif 1035 | !macroend 1036 | ${!insertmacro1-10} PreserveFilePre 1037 | 1038 | ;=== Remove specific directories 1039 | !macro RemoveDirectory _n 1040 | !ifdef REMOVEDIRECTORY${_n} 1041 | RMDir /r `$INSTDIR\${REMOVEDIRECTORY${_n}}` 1042 | !endif 1043 | !macroend 1044 | ${!insertmacro1-10} RemoveDirectory 1045 | 1046 | ;=== Rename the preserved directories so they're not deleted in the next part 1047 | !macro PreserveDirectoryPre _n 1048 | !ifdef PRESERVEDIRECTORY${_n} 1049 | Rename `$INSTDIR\${PRESERVEDIRECTORY${_n}}\` `$INSTDIR\~PRESERVEDIRECTORY${_n}\` 1050 | !endif 1051 | !macroend 1052 | ${!insertmacro1-10} PreserveDirectoryPre 1053 | 1054 | ;=== Remove main directories if necessary 1055 | !ifdef REMOVEAPPDIRECTORY 1056 | !ifdef COMMONFILESPLUGIN 1057 | ${GetParent} $INSTDIR $0 1058 | ${For} $1 1 10 1059 | Rename `$INSTDIR\~PRESERVEFILE$1\` `$0\~PRESERVEFILE$1\` 1060 | Rename `$INSTDIR\~PRESERVEDIRECTORY$1\` `$0\~PRESERVEDIRECTORY$1\` 1061 | ${Next} 1062 | RMDir /r $INSTDIR 1063 | CreateDirectory $INSTDIR 1064 | ${For} $1 1 10 1065 | Rename `$0\~PRESERVEFILE$1\` `$INSTDIR\~PRESERVEFILE$1\` 1066 | Rename `$0\~PRESERVEDIRECTORY$1\` `$INSTDIR\~PRESERVEDIRECTORY$1\` 1067 | ${Next} 1068 | !else 1069 | RMDir /r `$INSTDIR\App` 1070 | !endif 1071 | !endif 1072 | !ifdef REMOVEDATADIRECTORY 1073 | RMDir /r `$INSTDIR\Data` 1074 | !endif 1075 | !ifdef REMOVEOTHERDIRECTORY 1076 | RMDir /r `$INSTDIR\Other` 1077 | !endif 1078 | 1079 | ;=== Rename the preserved directories back to their proper names 1080 | !macro PreserveDirectoryPost _n 1081 | !ifdef PRESERVEDIRECTORY${_n} 1082 | ${GetParent} `$INSTDIR\${PRESERVEDIRECTORY${_n}}\` $R0 1083 | CreateDirectory $R0 1084 | Rename `$INSTDIR\~PRESERVEDIRECTORY${_n}\` `$INSTDIR\${PRESERVEDIRECTORY${_n}}\` 1085 | !endif 1086 | !macroend 1087 | ${!insertmacro1-10} PreserveDirectoryPost 1088 | 1089 | ;=== Rename the preserved files back to their proper names 1090 | !macro PreserveFilePost _n 1091 | !ifdef PRESERVEFILE${_n} 1092 | ${GetFileName} `$INSTDIR\${PRESERVEFILE${_n}}` $1 1093 | ${GetParent} `$INSTDIR\${PRESERVEFILE${_n}}` $2 1094 | CreateDirectory $2 1095 | ${MoveFiles} DOS $1 `$INSTDIR\~PRESERVEFILE${_n}` $2 1096 | RMDir `$INSTDIR\~PRESERVEFILE${_n}` 1097 | !endif 1098 | !macroend 1099 | ${!insertmacro1-10} PreserveFilePost 1100 | 1101 | ${If} $bolAppUpgrade == true 1102 | SetDetailsPrint both 1103 | DetailPrint $InstallingStatusString 1104 | SetDetailsPrint ListOnly 1105 | ${EndIf} 1106 | 1107 | !ifndef PLUGININSTALLER 1108 | File /x thumbs.db "..\..\*.exe" 1109 | File /x thumbs.db "..\..\*.html" 1110 | SetOutPath $INSTDIR\App 1111 | File /r /x thumbs.db "..\..\App\*.*" 1112 | !else ifdef COMMONFILESPLUGIN 1113 | SetOutPath $INSTDIR 1114 | File /r /x thumbs.db /x PortableApps.comInstaller*.* "..\..\*.*" 1115 | !else ; non-CommonFiles plugin installer 1116 | SetOutPath $INSTDIR\Data 1117 | File /nonfatal /r /x thumbs.db "..\..\Data\*.*" 1118 | SetOutPath $INSTDIR\App 1119 | File /nonfatal /r /x thumbs.db "..\..\App\*.*" 1120 | !endif 1121 | 1122 | SetOutPath $INSTDIR\Other 1123 | File /nonfatal /r /x thumbs.db /x PortableApps.comInstaller*.* "..\..\Other\*.*" 1124 | 1125 | SetOutPath $INSTDIR\Other\Source 1126 | !ifdef USESCUSTOMCODE 1127 | !if ${__FILE__} == "PortableApps.comInstallerPlugin.nsi" 1128 | File "..\..\Other\Source\PortableApps.comInstallerPluginCustom.nsh" 1129 | !else 1130 | File "..\..\Other\Source\PortableApps.comInstallerCustom.nsh" 1131 | !endif 1132 | !endif 1133 | !ifndef PLUGININSTALLER 1134 | CreateDirectory "$INSTDIR\Data" 1135 | !endif 1136 | 1137 | !ifdef INCLUDEINSTALLERSOURCE 1138 | File /r /x PortableApps.comInstallerCustom.nsh /x PortableApps.comInstallerPluginCustom.nsh "..\..\Other\Source\PortableApps.comInstaller*.*" 1139 | !endif 1140 | 1141 | ;=== Extract Download Files 1142 | !ifdef DownloadURL 1143 | !ifdef DownloadTo 1144 | ;Just copy the file 1145 | CopyFiles /SILENT "$DOWNLOADEDFILE" "$INSTDIR\${DownloadTo}" 1146 | !else 1147 | ;Process the file 1148 | !ifdef Extract1To 1149 | ;Standard extract 1150 | 1151 | !macro ExtractTo _n 1152 | !ifdef Extract${_n}To 1153 | CreateDirectory "$INSTDIR\${Extract${_n}To}" 1154 | nsisunz::UnzipToLog /file "${Extract${_n}File}" "$DOWNLOADEDFILE" "$INSTDIR\${Extract${_n}To}" 1155 | Pop $R0 1156 | ${If} $R0 <> "OK" 1157 | DetailPrint "ERROR: $R0 (${DownloadFilename} - ${Extract${_n}File})" 1158 | Abort 1159 | ${EndIf} 1160 | !endif 1161 | !macroend 1162 | ${!insertmacro1-10} ExtractTo 1163 | !endif 1164 | !ifdef AdvancedExtract1To 1165 | ;Advanced extract with 7zip 1166 | CreateDirectory "$INSTDIR\7zTemp" 1167 | SetOutPath "$INSTDIR\7zTemp" 1168 | File "${NSISDIR}\..\7zip\7z.exe" 1169 | File "${NSISDIR}\..\7zip\7z.dll" 1170 | SetOutPath $INSTDIR 1171 | 1172 | ; The original code didn't have a !ifdef for 1, but we 1173 | ; know it will be defined, and it doesn't matter if we 1174 | ; check if it is because it will be. 1175 | !macro AdvancedExtractFilter _n 1176 | !ifdef AdvancedExtract${_n}To 1177 | CreateDirectory "$INSTDIR\${AdvancedExtract${_n}To}" 1178 | ${If} "${AdvancedExtract${_n}Filter}" == "**" 1179 | ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" x -r "$DOWNLOADEDFILE" -o"$INSTDIR\${AdvancedExtract${_n}To}" * -aoa -y` "" "" 1180 | ${Else} 1181 | ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" x "$DOWNLOADEDFILE" -o"$INSTDIR\${AdvancedExtract${_n}To}" "${AdvancedExtract${_n}Filter}" -aoa -y` "" "" 1182 | ${EndIf} 1183 | Pop $R0 1184 | ${If} $R0 <> 0 1185 | DetailPrint "ERROR: (${DownloadFilename} > ${AdvancedExtract${_n}To})" 1186 | Abort 1187 | ${EndIf} 1188 | !endif 1189 | !macroend 1190 | ${!insertmacro1-10} AdvancedExtractFilter 1191 | 1192 | Delete "$INSTDIR\7zTemp\7z.dll" 1193 | Delete "$INSTDIR\7zTemp\7z.exe" 1194 | RMDir "$INSTDIR\7zTemp" 1195 | !endif 1196 | !ifdef DoubleExtractFilename 1197 | ;Double extract using 7zip 1198 | CreateDirectory "$INSTDIR\7zTemp" 1199 | SetOutPath "$INSTDIR\7zTemp" 1200 | File "${NSISDIR}\..\7zip\7z.exe" 1201 | File "${NSISDIR}\..\7zip\7z.dll" 1202 | SetOutPath $INSTDIR 1203 | 1204 | CreateDirectory "$PLUGINSDIR\Downloaded2" 1205 | ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" x "$DOWNLOADEDFILE" -o"$PLUGINSDIR\Downloaded2" "${DoubleExtractFilename}" -aoa -y` "" "" 1206 | Pop $R0 1207 | ${If} $R0 <> 0 1208 | DetailPrint "ERROR: (${DownloadFilename} > ${DoubleExtractFilename})" 1209 | Abort 1210 | ${EndIf} 1211 | 1212 | ; The original code didn't have a !ifdef for 1, but we 1213 | ; know it will be defined, and it doesn't matter if we 1214 | ; check if it is because it will be. 1215 | !macro DoubleExtractTo _n 1216 | !ifdef DoubleExtract${_n}To 1217 | CreateDirectory "$INSTDIR\${DoubleExtract${_n}To}" 1218 | ${If} "${DoubleExtract${_n}Filter}" == "**" 1219 | ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" x -r "$PLUGINSDIR\Downloaded2\${DoubleExtractFilename}" -o"$INSTDIR\${DoubleExtract${_n}To}" * -aoa -y` "" "" 1220 | ${Else} 1221 | ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" x "$PLUGINSDIR\Downloaded2\${DoubleExtractFilename}" -o"$INSTDIR\${DoubleExtract${_n}To}" "${DoubleExtract${_n}Filter}" -aoa -y` "" "" 1222 | ${EndIf} 1223 | Pop $R0 1224 | ${If} $R0 <> 0 1225 | DetailPrint "ERROR: (${DoubleExtractFilename} > ${DoubleExtract${_n}To})" 1226 | Abort 1227 | ${EndIf} 1228 | !endif 1229 | !macroend 1230 | ${!insertmacro1-10} DoubleExtractTo 1231 | 1232 | Delete "$INSTDIR\7zTemp\7z.exe" 1233 | Delete "$INSTDIR\7zTemp\7z.dll" 1234 | RMDir "$INSTDIR\7zTemp" 1235 | !endif 1236 | !endif 1237 | !endif 1238 | 1239 | ;=== Copy Local Files 1240 | !ifdef COPYLOCALFILES 1241 | ${If} ${FileExists} "$CopyLocalFilesFrom\*.*" 1242 | CreateDirectory "$INSTDIR\${CopyToDirectory}" 1243 | CopyFiles /SILENT "$CopyLocalFilesFrom\*.*" "$INSTDIR\${CopyToDirectory}" 1244 | ${Else} 1245 | StrCpy $MISSINGFILEORPATH $CopyLocalFilesFrom 1246 | ${If} $(copylocalfilesnotfound) != "" 1247 | MessageBox MB_OK|MB_ICONINFORMATION $(copylocalfilesnotfound) 1248 | ${Else} 1249 | MessageBox MB_OK|MB_ICONINFORMATION `This installer copies a local version of the application and makes it portable. Unfortunately, a local copy of the application was not found. You may reinstall or copy the files yourself to complete the installation at a later time. (ERROR: $MISSINGFILEORPATH could not be found.)` 1250 | ${EndIf} 1251 | ${EndIf} 1252 | !endif 1253 | 1254 | ;=== BEGIN: POST-INSTALL CODE === 1255 | ;This will be executed after the app is installed. Useful for updating configuration files. 1256 | !ifmacrodef CustomCodePostInstall 1257 | !insertmacro CustomCodePostInstall 1258 | !endif 1259 | ;=== END: POST-INSTALL CODE === 1260 | 1261 | !ifndef PLUGININSTALLER 1262 | ;=== Refresh PortableApps.com Menu (not final version) 1263 | ${GetParent} $INSTDIR $0 1264 | ;=== Check that it exists at the right location 1265 | SetDetailsPrint both 1266 | DetailPrint '$(checkforplatform)' 1267 | ${If} ${FileExists} `$0\PortableApps.com\PortableAppsPlatform.exe` 1268 | ;=== Check that it's the real deal so we aren't hanging with no response 1269 | MoreInfo::GetProductName `$0\PortableApps.com\PortableAppsPlatform.exe` 1270 | Pop $1 1271 | ${If} $1 == "PortableApps.com Platform" 1272 | MoreInfo::GetCompanyName `$0\PortableApps.com\PortableAppsPlatform.exe` 1273 | Pop $1 1274 | ${If} $1 == "PortableApps.com" 1275 | 1276 | ;=== Check that it's running 1277 | FindProcDLL::FindProc "PortableAppsPlatform.exe" 1278 | ${If} $R0 == "1" 1279 | 1280 | ;=== Send message for the Menu to refresh 1281 | CreateDirectory "$0\PortableApps.com\Data" 1282 | WriteINIStr "$0\PortableApps.com\Data\NewApp.ini" "NewApp" "AppID" "${APPID}" 1283 | 1284 | DetailPrint '$(refreshmenu)' 1285 | ${IfNot} ${FileExists} `$0\PortableApps.com\App\PortableAppsPlatform.exe` 1286 | StrCpy $2 'PortableApps.comPlatformWindowMessageToRefresh$0\PortableApps.com\PortableAppsPlatform.exe' 1287 | System::Call "user32::RegisterWindowMessage(t r2) i .r3" 1288 | SendMessage 65535 $3 0 0 /TIMEOUT=1 1289 | ${Else} ; old message 1290 | StrCpy $2 'PortableApps.comPlatformWindowMessageToRefresh$0\PortableApps.com\App\PortableAppsPlatform.exe' 1291 | System::Call "user32::RegisterWindowMessage(t r2) i .r3" 1292 | SendMessage 65535 $3 0 0 /TIMEOUT=1 1293 | ${EndIf} 1294 | ${EndIf} 1295 | ${EndIf} 1296 | ${EndIf} 1297 | ${EndIf} 1298 | !endif 1299 | DetailPrint $InstallingStatusString 1300 | SetDetailsPrint listonly 1301 | Delete "$INSTDIR\7zTemp\7z.exe" 1302 | Delete "$INSTDIR\7zTemp\7z.dll" 1303 | RMDir "$INSTDIR\7zTemp" 1304 | 1305 | !ifdef LICENSEAGREEMENT 1306 | CreateDirectory "$INSTDIR\Data\PortableApps.comInstaller" 1307 | WriteINIStr "$INSTDIR\Data\PortableApps.comInstaller\license.ini" "PortableApps.comInstaller" "EULAVersion" $INTERNALEULAVERSION 1308 | ClearErrors 1309 | !endif 1310 | 1311 | !ifdef DownloadURL 1312 | Delete "$INTERNET_CACHE\${DownloadFileName}" 1313 | !endif 1314 | ${If} $bolLogFile == true 1315 | ${DumpLogToFile} "$EXEDIR\$EXEFILE.log" 1316 | ${EndIf} 1317 | SetOutPath $INSTDIR 1318 | SectionEnd 1319 | 1320 | !ifdef MAINSECTIONTITLE 1321 | Section /o "${OPTIONALSECTIONTITLE}" 1322 | SetOutPath $INSTDIR 1323 | File /r "..\..\Optional1\*.*" 1324 | StrCpy $OPTIONAL1DONE "true" 1325 | SectionEnd 1326 | 1327 | Section "-UpdateAppInfo" SecUpdateAppInfo 1328 | !ifndef PLUGININSTALLER 1329 | ${If} $OPTIONAL1DONE != "true" 1330 | ${AndIf} "${OPTIONALSECTIONNOTSELECTEDINSTALLTYPE}" != "" 1331 | WriteINIStr "$INSTDIR\App\AppInfo\appinfo.ini" "Details" "InstallType" "${OPTIONALSECTIONNOTSELECTEDINSTALLTYPE}" 1332 | ${ElseIf} "${OPTIONALSECTIONSELECTEDINSTALLTYPE}" != "" 1333 | WriteINIStr "$INSTDIR\App\AppInfo\appinfo.ini" "Details" "InstallType" "${OPTIONALSECTIONSELECTEDINSTALLTYPE}" 1334 | ${EndIf} 1335 | !endif 1336 | SectionEnd 1337 | 1338 | !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN 1339 | !insertmacro MUI_DESCRIPTION_TEXT ${MAINSECTIONIDX} "${MAINSECTIONDESCRIPTION}" 1340 | !insertmacro MUI_DESCRIPTION_TEXT ${OPTIONALSECTIONIDX} "${OPTIONALSECTIONDESCRIPTION}" 1341 | !insertmacro MUI_FUNCTION_DESCRIPTION_END 1342 | !endif 1343 | 1344 | Function .onInstFailed 1345 | !ifdef COPYLOCALFILES 1346 | ${registry::Unload} 1347 | !endif 1348 | RMDir $INSTDIR ;remove directory if empty 1349 | FunctionEnd 1350 | 1351 | !ifdef COPYLOCALFILES 1352 | Function .onInstSuccess 1353 | ${registry::Unload} 1354 | FunctionEnd 1355 | Function CustomAbortFunction 1356 | ${registry::Unload} 1357 | FunctionEnd 1358 | !endif -------------------------------------------------------------------------------- /Other/Source/PortableApps.comInstallerCustom.nsh: -------------------------------------------------------------------------------- 1 | !macro CustomCodePostInstall 2 | 3 | ; Prepare folder to extract with 7zip 4 | CreateDirectory "$INSTDIR\7zTemp" 5 | SetOutPath "$INSTDIR\7zTemp" 6 | File "${NSISDIR}\..\7zip\7z.exe" 7 | File "${NSISDIR}\..\7zip\7z.dll" 8 | SetOutPath $INSTDIR 9 | 10 | inetc::get /CONNECTTIMEOUT 30 /NOCOOKIES /TRANSLATE "Downloading SourceTree..." "Connecting..." second minute hour s "%dkB (%d%%) of %dkB @ %d.%01dkB/s" " (%d %s%s remaining)" "http://downloads.atlassian.com/software/sourcetree/windows/ga/SourceTreeSetup-2.0.19.1.exe" "$INSTDIR\7zTemp\SourceTreeSetup-2.0.19.1.exe" /END 11 | 12 | ; Extract 13 | ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" e "$INSTDIR\7zTemp\SourceTreeSetup-2.0.19.1.exe" "SourceTree-2.0.19.1-full.nupkg" -o"$INSTDIR\7zTemp"` "" "" 14 | ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" x "$INSTDIR\7zTemp\SourceTree-2.0.19.1-full.nupkg" "lib\net45" -o"$INSTDIR\7zTemp"` "" "" 15 | ExecDOS::exec `xcopy "$INSTDIR\7zTemp\lib\net45" "$INSTDIR\App\SourceTree" /S /i` "" "" 16 | 17 | ; Cleanup 18 | RMDir /r "$INSTDIR\7zTemp" 19 | 20 | !macroend 21 | -------------------------------------------------------------------------------- /Other/Source/Readme.txt: -------------------------------------------------------------------------------- 1 | The base application's source code is available from the portable app's 2 | homepage listed in the help.html file. 3 | 4 | Details of most other things are available there as well. 5 | 6 | LICENSE 7 | ======= 8 | 9 | This package and its launcher are released under the GPL. The launcher is the 10 | PortableApps.com Launcher, available with full source and documentation from 11 | http://portableapps.com/development. We request that developers using the 12 | PortableApps.com Launcher please leave this directory intact and unchanged. 13 | 14 | USER CONFIGURATION 15 | ================== 16 | 17 | (For this section, AppNamePortable is the executable base file name, normally 18 | the App ID of the package.) 19 | 20 | Some configuration in the PortableApps.com Launcher can be overridden by the 21 | user in an INI file next to AppNamePortable.exe called AppNamePortable.ini. If 22 | you are happy with the default options, it is not necessary, though. There is 23 | an example INI included with this package to get you started. To use it, copy 24 | PortableApps.comLauncher.ini from this directory to AppNamePortable.ini next to 25 | AppNamePortable.exe. The options in the INI file are as follows:: 26 | 27 | AdditionalParameters= 28 | DisableSplashScreen=false 29 | RunLocally=false 30 | 31 | (There is no need for an INI header in this file; if you have one, though, it 32 | won't damage anything.) 33 | 34 | The AdditionalParameters entry allows you to pass additional command-line 35 | parameters to the application. 36 | 37 | The DisableSplashScreen entry allows you to run the launcher without the splash 38 | screen showing up. The default is false. 39 | 40 | The RunLocally entry allows you to run the portable application from a read- 41 | only medium. This is known as Live mode. It copies what it needs to to a 42 | temporary directory on the host computer, runs the application, and then 43 | deletes it afterwards, leaving nothing behind. This can be useful for running 44 | the application from a CD or if you work on a computer that may have spyware or 45 | viruses and you'd like to keep your device set to read-only. As a consequence 46 | of this technique, any changes you make during the Live mode session aren't 47 | saved back to your device. The default is false. 48 | 49 | There may be other values also permitted in the user configuration file by the 50 | portable application; refer to help.html for any details of them. 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Atlassian SourceTree Portable [![Release](https://img.shields.io/badge/release-v2.0.19.1.0-blue.svg)](https://github.com/cosmomill/SourceTreePortable/releases/latest) 2 | 3 | [Download the latest version](https://github.com/cosmomill/SourceTreePortable/releases/latest) of SourceTree Portable. 4 | 5 | ## Installation Prerequisites 6 | 7 | - Windows 7 or Windows 10 8 | - .NET Framework 4.5 9 | - At least 360 MB of free disk space 10 | 11 | ## Contributing Bug reports 12 | 13 | We use GitHub for bug tracking. Please search the existing issues for your bug and create a new one if the issue is not yet tracked! 14 | 15 | https://github.com/cosmomill/SourceTreePortable/issues 16 | -------------------------------------------------------------------------------- /help.html: -------------------------------------------------------------------------------- 1 | 2 | **App Name** Portable Help 3 | 4 | 5 | 150 | 151 | 152 | 153 |
154 |

**App Name** Portable Help

155 |

**insert catchy tag line**

156 |

**App Name** Portable is the **App Name** whatever it is packaged with a PortableApps.com launcher as a portable app, so you can **do something** on your iPod, USB flash drive, portable hard drive, etc. It has all the same features as **App Name**, plus, it leaves no personal information behind on the machine you run it on, so you can take it with you wherever you go. Learn more about **App Name**...

157 | 158 | Make a Donation - Support PortableApps.com's Hosting and Development 159 | 160 |

Go to the **App Name** Portable Homepage >>

161 | 162 |

Get more portable apps at PortableApps.com

163 | 164 |

This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative.

165 | 166 |

Portable App Issues

167 | 173 |

You can read about advanced configuration options for the PortableApps.com Launcher in its readme file. 174 | 175 |

176 | 177 | 178 | 179 | --------------------------------------------------------------------------------