Advertisement
Selur

NSIS Installer Script

Feb 24th, 2015
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.22 KB | None | 0 0
  1. ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  2. ;
  3. ; Hybrid NSIS installer script by FAUST
  4. ;
  5. ; This Script uses following features:
  6. ;
  7. ; - get the Version string of the Main Application Executabel (-> DL @ NSIS HP -> http://nsis.sourceforge.net/Invoking_NSIS_run-time_commands_on_compile-time)
  8. ; - OS diference of x64 and Windows2000 (-> x64.nsh & WinVer.nsh -> included in NSIS)
  9. ; - Aero Plug-in by AfrowUK (-> Aero.dll -> DL @ NSIS HP)
  10. ; - Win7 Progressbar Plugin by AfrowUK (-> w7tbp.dll -> DL @ NSIS HP)
  11. ;
  12. ;
  13. ;
  14. ;
  15. ;
  16. ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  17.  
  18. ;-----
  19. ; # Use the Modern Skin:
  20. !include "MUI.nsh"
  21. ; # for x64 detection:
  22. !include x64.nsh
  23. ; # for the Windows Version detection:
  24. !include WinVer.nsh
  25. ; # define the user plugin directory:
  26. !addplugindir ..\plugins
  27. ; # AERO Plug-in initialisation line
  28. !define MUI_CUSTOMFUNCTION_GUIINIT onGUIInit
  29. ; # to use the "locate" funtion for the reset/deletion section
  30. !include "FileFunc.nsh"
  31. ; # for .ini line editing
  32.  
  33. !include "WordFunc.nsh"
  34. ; # optional custom page choice
  35.  
  36. !include "logiclib.nsh"
  37. !include "sections.nsh"
  38.  
  39. ;!include InstallOptions.nsh
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. ;-----------------------------
  48. ;-----------------------------
  49. ;
  50. ; misc settings
  51. ;
  52. ; - compression level, OutFile, etc.
  53. ;-----------------------------
  54. # max compression settings
  55. SetCompressor /SOLID lzma
  56. SetDatablockOptimize on
  57. SetCompressorDictSize 120
  58. ; die DictSize sollte groesser sein als das unkomprimierte archiv insgesamt
  59. ; Aber NICHT grösser als 149 !!!
  60. ; Wenn der compiler mit dieser Meldung ended, dann muss die Dict Size kleiner eingestellt werden:
  61. ; ->> Packed 1 file.
  62. ; ->> Generating uninstaller... Internal compiler error #12345: deflateInit() failed(initialization failed [-2]).
  63. ; ->>
  64. ; ->> Note: you may have one or two (large) stale temporary file(s)
  65. ; ->> left in your temporary directory (Generally this only happens on Windows 9x).
  66.  
  67. ;
  68. ; ; # set "setcompress off" for testing purposes only +++> deactivate upper 3 compression Options!
  69. ; SetCompress off
  70.  
  71. ; # for the custom info page, initials
  72. ; # ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
  73. ReserveFile "..\plugins\_custompage-explain_links.ini"
  74. ; # Target Windows XP as minimal OS
  75. ; # TargetMinimalOS 5.1
  76. ;-----
  77.  
  78.  
  79. ;----------------
  80. ;----------------
  81. ; INITIALS
  82. ;
  83. ; - do things before the compiler creates the installer:
  84. ;----------------
  85. Function .onInit
  86. ; # GET the "FILE VERSION" FROM "HYBRID.EXE" and define it as "${VERSION}" for later usage in the installer
  87. ; from -> http://nsis.sourceforge.net/Invoking_NSIS_run-time_commands_on_compile-time
  88. !system "..\plugins\GetVersion-from-hybrid32\GetVersion-from-hybrid32.exe"
  89. !include "..\plugins\GetVersion-from-hybrid32\Version.txt"
  90. !include "..\plugins\Product.txt"
  91. ; # cut from the 2. right position for the title name for -> Caption "Hybrid - ${VERSION2}"
  92. StrCpy $1 "${VERSION}" -2
  93. !define VERSION2 "$1"
  94. ; # initialize the InfoPage
  95. !insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "..\plugins\_custompage-explain_links.ini" "InfoPage"
  96.  
  97.  
  98. InitPluginsDir
  99. File /oname=$PLUGINSDIR\_custompage-INI-DIR.ini "..\plugins\_custompage-INI-DIR.ini"
  100.  
  101.  
  102.  
  103. FunctionEnd
  104.  
  105.  
  106.  
  107. ; # (This function is called later in script -> onGUIInit)
  108. ; # Q: ALREADY EXIST INSTALLATION? -> if yes, quit? or go on with the installation?
  109. Function alreadyexistcheckfunktion
  110. ; # check RegKey existence
  111. ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "InstallPath"
  112. IfErrors jumpout ""
  113. ReadRegDWORD $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "InstallPath"
  114. MessageBox MB_ICONQUESTION|MB_YESNO "Looks like Hybrid is already installed in:$\r$\n$\r$\n$0$\r$\n$\r$\nDo you want to continue the installation anyway$\r$\nand update Hybrid?" IDYES jumpout
  115. ; # aborting and EXIT
  116. MessageBox MB_ICONINFORMATION|MB_OK "Stopping installation process"
  117. Abort
  118. ;---------EOS
  119. jumpout:
  120. FunctionEnd
  121.  
  122.  
  123.  
  124.  
  125. ; # Break the installation when OS is older then WinXP+SP2
  126. Function startcheckunsupportedOS
  127. ${If} ${IsWinXP}
  128. ${AndIf} ${AtMostServicePack} 1
  129. ${OrIf} ${AtMostWin2000}
  130. MessageBox MB_ICONINFORMATION|MB_OK "Hybrid only supports Windows XP (SP2) and newer versions of Windows!$\r$\n$\r$\nStopping installation process..."
  131. Abort
  132. ${EndIf}
  133. FunctionEnd
  134.  
  135.  
  136.  
  137. ; # Function needed for the deletion of the hybrid defaults (-> "HybridMain" Section)
  138. Function LocateCallback
  139.  
  140. Delete $R9
  141. Push $0
  142.  
  143. FunctionEnd
  144.  
  145. ; # Create the XML file for the mplayer Fonts setting
  146. Function fontxmlcreate
  147. FileOpen $R0 "$INSTDIR\fonts\local.conf" w
  148. GetFullPathName /SHORT $1 $APPDATA
  149. FileWriteUTF16LE $R0 '<!DOCTYPE fontconfig SYSTEM "fonts.dtd">$\n<fontconfig>$\n$\t<dir>$1\hybrid\fonts</dir>$\n$\t<cachedir>$1\hybrid\fontconfig\cache</cachedir>$\n</fontconfig>'
  150. FileClose $R0
  151. FunctionEnd
  152.  
  153.  
  154.  
  155.  
  156. ;-------------------------
  157. ;
  158. ; # INPUT DIRECTORYS
  159. ;
  160. ; Copy the binary into these directorys
  161.  
  162. !define BIN "..\_Hybrid_current-build_files-32"
  163. !define BIN64 "..\_Hybrid_current-build_files-64"
  164. !define BINaviext "..\_Hybrid_current-build_files-aviext"
  165. ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  166.  
  167.  
  168.  
  169.  
  170. ;--------------
  171. ; # Name of the compiled installer.exe
  172. OutFile "Hybrid_${VERSION}_SETUP.exe"
  173. ; # always overwrite files in destination directory
  174. SetOverwrite on
  175. ;--------------
  176. ; # standard target install directory: (will also work on 32bit OS !)
  177. InstallDir $PROGRAMFILES64\Hybrid
  178. ; -> look for an previously installation and use its path if detected
  179. InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "InstallPath"
  180. ;--------------
  181. ; # Main program name:
  182. Name "Hybrid"
  183. ; # The installer window title:
  184. Caption "Hybrid - ${VERSION2}"
  185. ; # "Gray text" title
  186. BrandingText "Hybrid installation setup"
  187. ; # this does somethink important.. i guess...
  188. CRCCheck on
  189.  
  190. ; # Use upx-runtime-compressor on the installer header to shrink the size. (for a couple of kb...)
  191. ; !packhdr header.dat "..\plugins\upx.exe --best header.dat"
  192. ;
  193. ; # Win7 taskbar progressbar plugin. (This Plug-in activates the Taskbar as progressbar under Windows 7)
  194. Function createInstFiles
  195. w7tbp::Start
  196. FunctionEnd
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. ; # for the ini choice
  206. Var UserIniPath
  207. ; Var DefaultIniDirectory
  208. Var DefaultIniDirectoryEscaped
  209. ; Var MiscIniDirectoryUnEscaped
  210. Var UserIniPathEscaped
  211. ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  212.  
  213.  
  214.  
  215. ;-----------------------------
  216. ;-----------------------------
  217. ;
  218. ; GENERAL SETTINGS
  219. ;
  220. ; - TITLE, TEXT & BUTTONS on PAGES
  221. ;-----------------------------
  222. ;
  223. ; # START PAGE text
  224. !define MUI_WELCOMEPAGE_TITLE "Hybrid ${VERSION2} - Setup Wizard"
  225. !define MUI_WELCOMEPAGE_TITLE_3LINES
  226. !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Hybrid.\r\n\r\nIf you have previously installed Hybrid and it is currently running, please exit Hybrid first before continuing this installation.\r\n\r\n$_CLICK"
  227. ;-----
  228. ; # COMPONENTS PAGE
  229. !define MUI_COMPONENTSPAGE_TEXT_TOP "Check the components you want to install and uncheck the components you don't want to install. The setup will install the right binarys for your OS. Click Next to continue."
  230. ;-----
  231. ; # INSTALL PAGE options
  232. ShowInstDetails show
  233. ; !define MUI_FINISHPAGE_NOAUTOCLOSE ; # deaktiviert das automatische schließen des InstallerPage Fenster
  234. ;-----
  235. ; # FINISH PAGE text / options
  236. !define MUI_FINISHPAGE_TITLE_3LINES
  237. ; !define MUI_FINISHPAGE_TEXT "Hybrid has been installed on your computer.\r\n\r\n\r\nDon't forget to copy the neroAacEnc.exe to the Hybrid program directory !\r\n\r\n\r\nClick Finish to close this wizard"
  238. !define MUI_FINISHPAGE_TEXT_LARGE
  239. ; # Run EXE ?
  240. !define MUI_FINISHPAGE_RUN "$INSTDIR\Hybrid.exe"
  241. !define MUI_FINISHPAGE_RUN_NOTCHECKED
  242. ; # WebPage
  243. !define MUI_FINISHPAGE_LINK "Visit the Hybrid website for the latest news"
  244. !define MUI_FINISHPAGE_LINK_LOCATION "http://www.selur.de/"
  245. ;-----
  246. ; # surface options / GFX
  247. !define MUI_WELCOMEFINISHPAGE_BITMAP "..\gfx\Hybrid-Welcome.bmp"
  248. !define MUI_UNWELCOMEFINISHPAGE_BITMAP "..\gfx\orange-uninstall.bmp"
  249. !define MUI_COMPONENTSPAGE_CHECKBITMAP "..\gfx\simple-round.bmp"
  250. !define MUI_COMPONENTSPAGE_SMALLDESC
  251. !define MUI_ABORTWARNING
  252. !define MUI_UNABORTWARNING
  253. !define MUI_ICON "..\gfx\hybrid-install-icon3.ico"
  254. !define MUI_UNICON "..\gfx\orange-uninstall.ico"
  255. !define MUI_HEADERIMAGE
  256. !define MUI_HEADERIMAGE_RIGHT
  257. !define MUI_HEADERIMAGE_BITMAP "..\gfx\Hybrid-Logo-Header.bmp"
  258. !define MUI_HEADERIMAGE_UNBITMAP "..\gfx\Hybrid-Logo-Header.bmp"
  259. ;-----------------------------------
  260. ; # Installer.exe file settings
  261. VIAddVersionKey "ProductName" "Hybrid"
  262. ; VIAddVersionKey "Comments" "DL newest version @ www.selur.de"
  263. ; VIAddVersionKey "CompanyName" "no company"
  264. VIAddVersionKey "LegalCopyright" "Hybrid.exe is © by Selur"
  265. VIAddVersionKey "FileDescription" "Setup for the Hybrid Package"
  266. VIAddVersionKey "ProductVersion" "${ProductV}" ; # predefined. something like-> !define ProductV "c000"
  267. VIAddVersionKey "FileVersion" "${VERSION}"
  268. VIProductVersion "${VERSION}"
  269.  
  270. ;-----------------------------------
  271. ; # insert pages
  272. !insertmacro MUI_PAGE_WELCOME
  273. !insertmacro MUI_PAGE_LICENSE "License2.rtf"
  274.  
  275. !insertmacro MUI_PAGE_COMPONENTS
  276. !insertmacro MUI_PAGE_DIRECTORY
  277. ; !insertmacro MUI_PAGE_INSTFILES
  278. ; # Custom page for ini selection. Only appears when option is selected on the components page
  279. Page Custom CustomUserIniPage
  280. Page instfiles "" createInstFiles ; # instead of the standard-installpage ("MUI_PAGE_INSTFILES"). for the Windows taskbar progressbar plugin
  281. Page Custom CustomInfoPage
  282.  
  283. !insertmacro MUI_PAGE_FINISH
  284. !insertmacro MUI_UNPAGE_WELCOME
  285. !insertmacro MUI_UNPAGE_CONFIRM
  286. !insertmacro MUI_UNPAGE_INSTFILES
  287. !insertmacro MUI_UNPAGE_FINISH
  288. !insertmacro MUI_LANGUAGE "English"
  289. ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  290.  
  291.  
  292.  
  293. ;-----------------------------
  294. ;-----------------------------
  295. ;
  296. ; onGUIInit Functions
  297. ;
  298. ;-----------------------------
  299. Function onGUIInit
  300. ; # Break the installation when OS is older then WinXP+SP2
  301. CALL startcheckunsupportedOS
  302. ; # Aero window plugin activation - have to be activated later in the script
  303. Aero::Apply [Options]
  304. ; # on installer start: look for an previously installed version:
  305. CALL alreadyexistcheckfunktion
  306. FunctionEnd
  307. ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  308.  
  309.  
  310.  
  311. ;-----------------------------
  312. ;-----------------------------
  313. ;
  314. ; Installer Page Sections
  315. ;
  316. ; - Options showed at the section page:
  317. ;-----------------------------
  318.  
  319. SubSection "!Hybrid" HybridMain
  320.  
  321. ;## ALL MAIN INSTALLATION PROCEDURES IN THIS SECTION
  322. Section "Main Files" hybrid32
  323. ; # -> RO : read only : forced=ON
  324. SectionIn RO
  325. SetOutPath $INSTDIR
  326.  
  327. ; Delete license.txt if it contains 1 of these lines...
  328. Push 1 ;line number to read from
  329. Push "$INSTDIR\avisynthPlugins\license.txt" ;text file to read
  330. Call ReadFileLine
  331. Pop $0 ;output string (read from file.txt)
  332. ;MessageBox mb_ok $0
  333. ${If} $0 = "9f0a2b12001bf7424c692b0d05e21a62b0661d42d7813d8c8ba65ba548852545"
  334. ; MessageBox mb_ok if1
  335. Delete "$INSTDIR\avisynthPlugins\license.txt"
  336. ${EndIf}
  337.  
  338. ${If} $0 = "546b27acf3bd962b68200ecad1b5137e34ce790a129de7606c7b5773aae99b6e"
  339. ; MessageBox mb_ok if2
  340. Delete "$INSTDIR\avisynthPlugins\license.txt"
  341. ${EndIf}
  342.  
  343.  
  344. File /r "${BIN}\*"
  345.  
  346. ; # if OS=x64 then copy binarys from BIN64 direcory
  347. ${If} ${RunningX64}
  348. File /r "${BIN64}\*.*"
  349. ${EndIf}
  350.  
  351. ; # Always copy 32bit avsInfo.exe and avsViewer into installdir, overwriting the 64bit files
  352. File "${BIN}\avsInfo.exe"
  353. File "${BIN}\avsViewer.exe"
  354. # if OS=Winx64 then copy 32bit mkvmerge&co
  355. ${If} ${IsWinXP}
  356. ${If} ${RunningX64}
  357. File /r "${BIN}\mkvextract.exe"
  358. File /r "${BIN}\mkvinfo.exe"
  359. File /r "${BIN}\mkvmerge.exe"
  360. ${EndIf}
  361. ${EndIf}
  362. ; # delete always Hybrid´s "ModelDefaults" during the installation in "%appdata%/hybrid"
  363. IfFileExists "$APPDATA\hybrid" "" "+2"
  364. ${Locate} "$APPDATA\hybrid" "/L=F /M=* Hybrid Default.xml" "LocateCallback"
  365.  
  366. ; # Create the XML file for the mplayer Fonts setting
  367. IfFileExists "$INSTDIR\fonts\local.conf" 0 +2
  368. Delete "$INSTDIR\fonts\local.conf"
  369.  
  370. Call fontxmlcreate
  371.  
  372. SectionEnd
  373.  
  374. SubSectionEnd
  375.  
  376. SubSection "Shortcuts" Shortcuts
  377. ; # Startmenu entrys
  378. Section "Start Menu" StartMenu
  379. SetOutPath $INSTDIR
  380. SetShellVarContext current
  381. CreateDirectory "$SMPROGRAMS\Hybrid"
  382. CreateShortCut "$SMPROGRAMS\Hybrid\Hybrid.lnk" "$INSTDIR\Hybrid.exe"
  383. CreateShortCut "$SMPROGRAMS\Hybrid\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
  384. SectionEnd
  385.  
  386. ; # Desktop Icon
  387. Section "Desktop" Desktop
  388. SetShellVarContext current
  389. SetOutPath $INSTDIR
  390. CreateShortCut "$DESKTOP\Hybrid.lnk" "$INSTDIR\Hybrid.exe"
  391.  
  392. SectionEnd
  393.  
  394. SubSectionEnd
  395.  
  396.  
  397. SubSection /e "Options" Options
  398. ; # reset Hybrid defaults settings on start of the installation?
  399. ; (this will just delete the config files on the default directory)
  400.  
  401. Section "Avisynth Extension" avisynthext
  402. SetShellVarContext current
  403. File /r "${BINaviext}\*"
  404. SectionEnd
  405.  
  406.  
  407. Section /o "Reset Defaults" delDef
  408. SetShellVarContext current
  409. IfFileExists "$APPDATA\hybrid\*ModelDefaults.xml" "" "notdeleteonsection"
  410. Delete "$APPDATA\hybrid\*ModelDefaults.xml"
  411.  
  412. notdeleteonsection:
  413.  
  414. SectionEnd
  415. ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  416.  
  417.  
  418.  
  419. ; ; MessageBox MB_OK "misc $MiscIniDirectoryUnEscaped"
  420. ;-----------------------------
  421. ;-----------------------------
  422. ;
  423. ; CUSTOM PAGE - misc.INI
  424. ;
  425. ; - this Custom page will ask for a User defined Settings path
  426. ;-----------------------------
  427. Section /o "User defined settings path" UserIniChoice
  428.  
  429. SectionEnd
  430.  
  431. SubSectionEnd
  432.  
  433.  
  434. Function ReadFileLine
  435. Exch $0 ;file
  436. Exch
  437. Exch $1 ;line number
  438. Push $2
  439. Push $3
  440.  
  441. FileOpen $2 $0 r
  442. StrCpy $3 0
  443.  
  444. Loop:
  445. IntOp $3 $3 + 1
  446. ClearErrors
  447. FileRead $2 $0
  448. IfErrors +2
  449. StrCmp $3 $1 0 loop
  450. FileClose $2
  451.  
  452. Pop $3
  453. Pop $2
  454. Pop $1
  455. Exch $0
  456. FunctionEnd
  457.  
  458.  
  459. Function CustomInfoPage
  460.  
  461. ; ; # for the custom info page, install directory replacement
  462. InitPluginsDir
  463. File /oname=$PLUGINSDIR\_custompage-explain_links.ini "..\plugins\_custompage-explain_links.ini"
  464. ; WriteIniStr $PLUGINSDIR\_custompage-explain_links.ini "Field 6" "State" '"$INSTDIR"'
  465.  
  466.  
  467. ; # Headlines
  468. !insertmacro MUI_HEADER_TEXT "Further Installation Information" " "
  469. ; # show the Page
  470. ;#version1
  471. ; !insertmacro MUI_INSTALLOPTIONS_DISPLAY "InfoPage"
  472. ;#version2
  473. InstallOptions::dialog "$PLUGINSDIR\_custompage-explain_links.ini"
  474.  
  475. FunctionEnd
  476.  
  477.  
  478. Function CustomUserIniPage
  479. ${IfNot} ${SectionIsSelected} ${UserIniChoice}
  480. Abort
  481. ${EndIf}
  482.  
  483. #--------------------
  484. ; define default settings dir, in dependency of the user system path
  485. !define DefaultIniDirectory "$APPDATA\hybrid"
  486. ; create an escaped version of that path
  487. ${WordReplace} "${DefaultIniDirectory}" "\" "\\" "+" $DefaultIniDirectoryEscaped
  488. ; write CustomPage .ini with path from MISC.ini <IF EXIST
  489. WriteINIStr "$PLUGINSDIR\_custompage-INI-DIR.ini" "Field 2" "state" ${DefaultIniDirectory}
  490.  
  491. ; write CustomPage .ini with updated %APPDATA%\hybrid
  492. WriteINIStr "$PLUGINSDIR\_custompage-INI-DIR.ini" "Field 3" "text" `Please choose a path for the settings files.\r\nIf you don´t know what that means, just leave the path to the default path: "%APPDATA%\hybrid"\r\n\r\nOn your machine the default path is:\r\n"${DefaultIniDirectory}"`
  493.  
  494. ; # Headlines
  495. !insertmacro MUI_HEADER_TEXT "Optional Path Setting" "Please define a path."
  496.  
  497. ; # show the custom page dialog
  498. Push $R0
  499. InstallOptions::dialog $PLUGINSDIR\_custompage-INI-DIR.ini
  500.  
  501. Pop $R0
  502. ; get the user dialog string
  503. ReadINIStr $UserIniPath "$PLUGINSDIR\_custompage-INI-DIR.ini" "Field 2" "state"
  504. ; escape the path from the input
  505. ${WordReplace} "$UserIniPath" "\" "\\" "+" $UserIniPathEscaped
  506. WriteINIStr "$INSTDIR\misc.ini" General settingPath $UserIniPathEscaped
  507. Pop $R0
  508.  
  509.  
  510. FunctionEnd
  511. ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  512.  
  513.  
  514.  
  515.  
  516. ;-----------------------------
  517. ;-----------------------------
  518. ;
  519. ; uninstall tasks
  520. ;
  521. ; - things to do at the execution of the uninstall.exe
  522. ;-----------------------------
  523. Section "Uninstall"
  524. SetShellVarContext all
  525.  
  526. ; # Check validity of the $INSTDIR variable. Compares the uninstall.exe location with the RegKey value.
  527. ClearErrors
  528. ReadRegStr $2 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "InstallPath"
  529. IfErrors 0 +2
  530. ReadRegStr $2 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "InstallPath"
  531. ${If} $2 != $INSTDIR
  532. ; # Something is wrong! Fall back to checking for filenames.
  533. ${IfNot} ${FileExists} "$INSTDIR\Hybrid.exe"
  534. MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "WARNING: Setup could not verify that this uninstaller is being run from its proper \
  535. directory. If you have moved Uninstall.exe to a directory other than the actual installation folder, it is \
  536. impossible to guarantee that the uninstallation will be executed properly. If you proceed, it is theoretically \
  537. possible that setup will delete files that should not be deleted. Are you sure you wish to continue with \
  538. the uninstallation?$\r$\r-OK to continue and uninstall the application from:$\r$\n '$2' $\r$\n-CANCEL to end" IDOK +2
  539. quit ; # quit installer.
  540. ${EndIf}
  541. ${EndIf}
  542.  
  543. Delete "$DESKTOP\Hybrid.lnk"
  544. Delete "$INSTDIR\Uninstall.exe"
  545. Delete "$SMPROGRAMS\Hybrid\*.*"
  546. RMDir "$SMPROGRAMS\Hybrid"
  547. RMDir /r $2
  548. DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid"
  549. ; ; # 2
  550. SetShellVarContext current
  551. Delete "$DESKTOP\Hybrid.lnk"
  552. Delete "$SMPROGRAMS\Hybrid\*.*"
  553. RMDir "$SMPROGRAMS\Hybrid"
  554. DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid"
  555. ; # clear config directory ?
  556. ;SetShellVarContext current
  557. ; exist standart hybrid config direktory?
  558. IfFileExists "$APPDATA\hybrid\*.*" "" jumpundelconfig
  559. MessageBox MB_ICONQUESTION|MB_YESNO "$\r$\nDo you want to delete all of your Hybrid config files and settings?" IDNO jumpundelconfig
  560. ; YES? then delete Hybrid settings -> del DIR
  561. RMDir /r "$APPDATA\hybrid"
  562. jumpundelconfig:
  563. SectionEnd
  564. ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  565.  
  566.  
  567.  
  568. ;-----------------------------
  569. ;-----------------------------
  570. ;
  571. ; create uninstaller.exe and RegKeys
  572. ;
  573. ; - create uninstaller.exe and neccessary RegKeys
  574. ;-----------------------------
  575. Section -End
  576. WriteUninstaller "$INSTDIR\Uninstall.exe"
  577. ; # The registry entries simply add the Hybrid uninstaller to the Windowsuninstall list.
  578. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "DisplayName" "Hybrid (remove only)"
  579. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "UninstallString" '$INSTDIR\Uninstall.exe'
  580. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "DisplayIcon" '$INSTDIR\Hybrid.exe'
  581. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "InstallPath" '$INSTDIR'
  582. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "HelpLink" "http://forum.selur.de/"
  583. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "URLInfoAbout" "http://www.selur.de"
  584. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "Publisher" "Selur´s Hybrid"
  585. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "DisplayVersion" "${VERSION}"
  586. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Hybrid" "EstimatedSize" "0x00017318"
  587. SectionEnd
  588. ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  589.  
  590.  
  591.  
  592. ;-----------------------------
  593. ;-----------------------------
  594. ;
  595. ; Descriptions for the Components Page options
  596. ;
  597. ; - define the text lines that will be shown at the components page
  598. ;-----------------------------
  599. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  600. !insertmacro MUI_DESCRIPTION_TEXT ${Hybridmain} "Install all the provided files for Hybrid."
  601. !insertmacro MUI_DESCRIPTION_TEXT ${Hybrid32} "The core executable needed for Hybrid to run."
  602. !insertmacro MUI_DESCRIPTION_TEXT ${avsInfo} "This will install the 64bit avsInfo.exe for Hybrid. In case you want to use 64bit AviSynth Scripts on 64bit OS."
  603. !insertmacro MUI_DESCRIPTION_TEXT ${ffmpeg} "This will install the 32bit ffmpeg.exe instead of the 64bit Version on a 64bit OS."
  604. !insertmacro MUI_DESCRIPTION_TEXT ${delDef} "Reset the Hybrid settings to default values."
  605. !insertmacro MUI_DESCRIPTION_TEXT ${avisynthext} "Install the Avisynth Extension."
  606. !insertmacro MUI_DESCRIPTION_TEXT ${UserIniChoice} "You can specify your own settings directory. The place where Hybrid stores its settings."
  607. !insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} "Create shortcuts to access Hybrid from the Start Menu."
  608. !insertmacro MUI_DESCRIPTION_TEXT ${desktop} "Create shortcut at the desktop."
  609. !insertmacro MUI_DESCRIPTION_TEXT ${Shortcuts} "Shortcuts"
  610. !insertmacro MUI_DESCRIPTION_TEXT ${Options} "Advanced Options"
  611. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  612. ;-----------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement