Advertisement
Guest User

Untitled

a guest
Aug 18th, 2013
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.             ${If} ${FileExists} "$INSTDIR\${DownloadTo}\*.*"
  1146.                 MessageBox MB_OK|MB_ICONINFORMATION "$INSTDIR\${DownloadTo}\ exists"
  1147.             ${Else}
  1148.                 MessageBox MB_OK|MB_ICONINFORMATION "$INSTDIR\${DownloadTo}\ does not exist"
  1149.             ${EndIf}
  1150.            
  1151.             CopyFiles /SILENT "$DOWNLOADEDFILE" "$INSTDIR\${DownloadTo}\"
  1152.            
  1153.             MessageBox MB_OK|MB_ICONINFORMATION "Please check the contents of $INSTDIR\${DownloadTo}\ now"
  1154.         !else
  1155.         ;Process the file
  1156.             !ifdef Extract1To
  1157.                 ;Standard extract
  1158.  
  1159.                 !macro ExtractTo _n
  1160.                     !ifdef Extract${_n}To
  1161.                         CreateDirectory "$INSTDIR\${Extract${_n}To}"
  1162.                         nsisunz::UnzipToLog /file "${Extract${_n}File}" "$DOWNLOADEDFILE" "$INSTDIR\${Extract${_n}To}"
  1163.                         Pop $R0
  1164.                         ${If} $R0 <> "OK"
  1165.                             DetailPrint "ERROR: $R0 (${DownloadFilename} - ${Extract${_n}File})"
  1166.                             Abort
  1167.                         ${EndIf}
  1168.                     !endif
  1169.                 !macroend
  1170.                 ${!insertmacro1-10} ExtractTo
  1171.             !endif
  1172.             !ifdef AdvancedExtract1To
  1173.                 ;Advanced extract with 7zip
  1174.                 CreateDirectory "$INSTDIR\7zTemp"
  1175.                 SetOutPath "$INSTDIR\7zTemp"
  1176.                 File "${NSISDIR}\..\7zip\7z.exe"
  1177.                 File "${NSISDIR}\..\7zip\7z.dll"
  1178.                 SetOutPath $INSTDIR
  1179.  
  1180.                 ; The original code didn't have a !ifdef for 1, but we
  1181.                 ; know it will be defined, and it doesn't matter if we
  1182.                 ; check if it is because it will be.
  1183.                 !macro AdvancedExtractFilter _n
  1184.                     !ifdef AdvancedExtract${_n}To
  1185.                         CreateDirectory "$INSTDIR\${AdvancedExtract${_n}To}"
  1186.                         ${If} "${AdvancedExtract${_n}Filter}" == "**"
  1187.                             ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" x -r "$DOWNLOADEDFILE" -o"$INSTDIR\${AdvancedExtract${_n}To}" * -aoa -y` "" ""
  1188.                         ${Else}
  1189.                             ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" x "$DOWNLOADEDFILE" -o"$INSTDIR\${AdvancedExtract${_n}To}" "${AdvancedExtract${_n}Filter}" -aoa -y` "" ""
  1190.                         ${EndIf}
  1191.                         Pop $R0
  1192.                         ${If} $R0 <> 0
  1193.                             DetailPrint "ERROR: (${DownloadFilename} > ${AdvancedExtract${_n}To})"
  1194.                             Abort
  1195.                         ${EndIf}
  1196.                     !endif
  1197.                 !macroend
  1198.                 ${!insertmacro1-10} AdvancedExtractFilter
  1199.  
  1200.                 Delete "$INSTDIR\7zTemp\7z.dll"
  1201.                 Delete "$INSTDIR\7zTemp\7z.exe"
  1202.                 RMDir "$INSTDIR\7zTemp"
  1203.             !endif
  1204.             !ifdef DoubleExtractFilename
  1205.                 ;Double extract using 7zip
  1206.                 CreateDirectory "$INSTDIR\7zTemp"
  1207.                 SetOutPath "$INSTDIR\7zTemp"
  1208.                 File "${NSISDIR}\..\7zip\7z.exe"
  1209.                 File "${NSISDIR}\..\7zip\7z.dll"
  1210.                 SetOutPath $INSTDIR
  1211.  
  1212.                 CreateDirectory "$PLUGINSDIR\Downloaded2"
  1213.                 ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" x "$DOWNLOADEDFILE" -o"$PLUGINSDIR\Downloaded2" "${DoubleExtractFilename}" -aoa -y` "" ""
  1214.                 Pop $R0
  1215.                 ${If} $R0 <> 0
  1216.                     DetailPrint "ERROR: (${DownloadFilename} > ${DoubleExtractFilename})"
  1217.                     Abort
  1218.                 ${EndIf}
  1219.  
  1220.                 ; The original code didn't have a !ifdef for 1, but we
  1221.                 ; know it will be defined, and it doesn't matter if we
  1222.                 ; check if it is because it will be.
  1223.                 !macro DoubleExtractTo _n
  1224.                     !ifdef DoubleExtract${_n}To
  1225.                         CreateDirectory "$INSTDIR\${DoubleExtract${_n}To}"
  1226.                         ${If} "${DoubleExtract${_n}Filter}" == "**"
  1227.                             ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" x -r "$PLUGINSDIR\Downloaded2\${DoubleExtractFilename}" -o"$INSTDIR\${DoubleExtract${_n}To}" * -aoa -y` "" ""
  1228.                         ${Else}
  1229.                             ExecDOS::exec `"$INSTDIR\7zTemp\7z.exe" x "$PLUGINSDIR\Downloaded2\${DoubleExtractFilename}" -o"$INSTDIR\${DoubleExtract${_n}To}" "${DoubleExtract${_n}Filter}" -aoa -y` "" ""
  1230.                         ${EndIf}
  1231.                         Pop $R0
  1232.                         ${If} $R0 <> 0
  1233.                             DetailPrint "ERROR: (${DoubleExtractFilename} > ${DoubleExtract${_n}To})"
  1234.                             Abort
  1235.                         ${EndIf}
  1236.                     !endif
  1237.                 !macroend
  1238.                 ${!insertmacro1-10} DoubleExtractTo
  1239.  
  1240.                 Delete "$INSTDIR\7zTemp\7z.exe"
  1241.                 Delete "$INSTDIR\7zTemp\7z.dll"
  1242.                 RMDir "$INSTDIR\7zTemp"
  1243.             !endif
  1244.         !endif
  1245.     !endif
  1246.  
  1247.     ;=== Copy Local Files
  1248.     !ifdef COPYLOCALFILES
  1249.         ${If} ${FileExists} "$CopyLocalFilesFrom\*.*"
  1250.             CreateDirectory "$INSTDIR\${CopyToDirectory}"
  1251.             CopyFiles /SILENT "$CopyLocalFilesFrom\*.*" "$INSTDIR\${CopyToDirectory}"
  1252.         ${Else}
  1253.             StrCpy $MISSINGFILEORPATH $CopyLocalFilesFrom
  1254.             ${If} $(copylocalfilesnotfound) != ""
  1255.                 MessageBox MB_OK|MB_ICONINFORMATION $(copylocalfilesnotfound)
  1256.             ${Else}
  1257.                 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.)`
  1258.             ${EndIf}
  1259.         ${EndIf}
  1260.     !endif
  1261.  
  1262.     ;=== BEGIN: POST-INSTALL CODE ===
  1263.     ;This will be executed after the app is installed.  Useful for updating configuration files.
  1264.     !ifmacrodef CustomCodePostInstall
  1265.         !insertmacro CustomCodePostInstall
  1266.     !endif
  1267.     ;=== END: POST-INSTALL CODE ===
  1268.  
  1269.     !ifndef PLUGININSTALLER
  1270.         ;=== Refresh PortableApps.com Menu (not final version)
  1271.         ${GetParent} $INSTDIR $0
  1272.         ;=== Check that it exists at the right location
  1273.         SetDetailsPrint both
  1274.         DetailPrint '$(checkforplatform)'
  1275.         ${If} ${FileExists} `$0\PortableApps.com\PortableAppsPlatform.exe`
  1276.             ;=== Check that it's the real deal so we aren't hanging with no response
  1277.             MoreInfo::GetProductName `$0\PortableApps.com\PortableAppsPlatform.exe`
  1278.             Pop $1
  1279.             ${If} $1 == "PortableApps.com Platform"
  1280.                 MoreInfo::GetCompanyName `$0\PortableApps.com\PortableAppsPlatform.exe`
  1281.                 Pop $1
  1282.                 ${If} $1 == "PortableApps.com"
  1283.  
  1284.                     ;=== Check that it's running
  1285.                     FindProcDLL::FindProc "PortableAppsPlatform.exe"
  1286.                     ${If} $R0 == "1"
  1287.  
  1288.                         ;=== Send message for the Menu to refresh
  1289.                         CreateDirectory "$0\PortableApps.com\Data"
  1290.                         WriteINIStr "$0\PortableApps.com\Data\NewApp.ini" "NewApp" "AppID" "${APPID}"
  1291.  
  1292.                         DetailPrint '$(refreshmenu)'
  1293.                         ${IfNot} ${FileExists} `$0\PortableApps.com\App\PortableAppsPlatform.exe`
  1294.                             StrCpy $2 'PortableApps.comPlatformWindowMessageToRefresh$0\PortableApps.com\PortableAppsPlatform.exe'
  1295.                             System::Call "user32::RegisterWindowMessage(t r2) i .r3"
  1296.                             SendMessage 65535 $3 0 0 /TIMEOUT=1
  1297.                         ${Else} ; old message
  1298.                             StrCpy $2 'PortableApps.comPlatformWindowMessageToRefresh$0\PortableApps.com\App\PortableAppsPlatform.exe'
  1299.                             System::Call "user32::RegisterWindowMessage(t r2) i .r3"
  1300.                             SendMessage 65535 $3 0 0 /TIMEOUT=1
  1301.                         ${EndIf}
  1302.                     ${EndIf}
  1303.                 ${EndIf}
  1304.             ${EndIf}
  1305.         ${EndIf}
  1306.     !endif
  1307.         DetailPrint $InstallingStatusString
  1308.         SetDetailsPrint listonly
  1309.         Delete "$INSTDIR\7zTemp\7z.exe"
  1310.         Delete "$INSTDIR\7zTemp\7z.dll"
  1311.         RMDir "$INSTDIR\7zTemp"
  1312.  
  1313. !ifdef LICENSEAGREEMENT
  1314.     CreateDirectory "$INSTDIR\Data\PortableApps.comInstaller"
  1315.     WriteINIStr "$INSTDIR\Data\PortableApps.comInstaller\license.ini" "PortableApps.comInstaller" "EULAVersion" $INTERNALEULAVERSION
  1316.     ClearErrors
  1317. !endif
  1318.  
  1319. !ifdef DownloadURL
  1320.     Delete "$INTERNET_CACHE\${DownloadFileName}"
  1321. !endif
  1322.     ${If} $bolLogFile == true
  1323.         ${DumpLogToFile} "$EXEDIR\$EXEFILE.log"
  1324.     ${EndIf}
  1325.     SetOutPath $INSTDIR
  1326. SectionEnd
  1327.  
  1328. !ifdef MAINSECTIONTITLE
  1329.     Section /o "${OPTIONALSECTIONTITLE}"
  1330.         SetOutPath $INSTDIR
  1331.         File /r "..\..\Optional1\*.*"
  1332.         StrCpy $OPTIONAL1DONE "true"
  1333.     SectionEnd
  1334.  
  1335.     Section "-UpdateAppInfo" SecUpdateAppInfo
  1336.     !ifndef PLUGININSTALLER
  1337.         ${If} $OPTIONAL1DONE != "true"
  1338.         ${AndIf} "${OPTIONALSECTIONNOTSELECTEDINSTALLTYPE}" != ""
  1339.             WriteINIStr "$INSTDIR\App\AppInfo\appinfo.ini" "Details" "InstallType" "${OPTIONALSECTIONNOTSELECTEDINSTALLTYPE}"
  1340.         ${ElseIf} "${OPTIONALSECTIONSELECTEDINSTALLTYPE}" != ""
  1341.             WriteINIStr "$INSTDIR\App\AppInfo\appinfo.ini" "Details" "InstallType" "${OPTIONALSECTIONSELECTEDINSTALLTYPE}"
  1342.         ${EndIf}
  1343.     !endif
  1344.     SectionEnd
  1345.  
  1346.     !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  1347.         !insertmacro MUI_DESCRIPTION_TEXT ${MAINSECTIONIDX} "${MAINSECTIONDESCRIPTION}"
  1348.         !insertmacro MUI_DESCRIPTION_TEXT ${OPTIONALSECTIONIDX} "${OPTIONALSECTIONDESCRIPTION}"
  1349.     !insertmacro MUI_FUNCTION_DESCRIPTION_END
  1350. !endif
  1351.  
  1352. Function .onInstFailed
  1353.     !ifdef COPYLOCALFILES
  1354.         ${registry::Unload}
  1355.     !endif
  1356.     RMDir $INSTDIR ;remove directory if empty
  1357. FunctionEnd
  1358.  
  1359. !ifdef COPYLOCALFILES
  1360.     Function .onInstSuccess
  1361.         ${registry::Unload}
  1362.     FunctionEnd
  1363.     Function CustomAbortFunction
  1364.         ${registry::Unload}
  1365.     FunctionEnd
  1366. !endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement