1 ; ///////////////////////////////////////////////////////////////////////////////
2 ; // Simple x264 Launcher
3 ; // Copyright (C) 2004-2016 LoRd_MuldeR <MuldeR2@GMX.de>
5 ; // This program is free software; you can redistribute it and/or modify
6 ; // it under the terms of the GNU General Public License as published by
7 ; // the Free Software Foundation; either version 2 of the License, or
8 ; // (at your option) any later version.
10 ; // This program is distributed in the hope that it will be useful,
11 ; // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ; // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ; // GNU General Public License for more details.
15 ; // You should have received a copy of the GNU General Public License along
16 ; // with this program; if not, write to the Free Software Foundation, Inc.,
17 ; // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 ; // http://www.gnu.org/licenses/gpl-2.0.txt
20 ; ///////////////////////////////////////////////////////////////////////////////
23 ;--------------------------------
25 ;--------------------------------
28 !error "NSIS_UNICODE is undefined, please compile with Unicode NSIS !!!"
32 !error "X264_BUILD is not defined !!!"
35 !error "X264_DATE is not defined !!!"
37 !ifndef X264_OUTPUT_FILE
38 !error "X264_OUTPUT_FILE is not defined !!!"
40 !ifndef X264_SOURCE_PATH
41 !error "X264_SOURCE_PATH is not defined !!!"
44 !error "X264_UPX_PATH is not defined !!!"
48 !define MyRegPath "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{986E454F-DACA-4326-A9C7-3E46C0BFFDCE}"
51 !define MyWebSite "http://muldersoft.com/"
54 ;--------------------------------
56 ;--------------------------------
59 !packhdr "${PACKHDRTEMP}" '"..\mt.exe" -manifest "setup.manifest" -outputresource:"${PACKHDRTEMP};1"'
62 ;--------------------------------
64 ;--------------------------------
69 !include `StdUtils.nsh`
72 ;--------------------------------
74 ;--------------------------------
76 RequestExecutionLevel admin
78 ShowUninstDetails show
79 Name "Simple x264/x265 Launcher [Build #${X264_BUILD}]"
80 OutFile "${X264_OUTPUT_FILE}"
81 BrandingText "Date created: ${X264_DATE} [Build #${X264_BUILD}]"
82 InstallDir "$PROGRAMFILES\MuldeR\Simple x264 Launcher v2"
83 InstallDirRegKey HKLM "${MyRegPath}" "InstallLocation"
86 ;--------------------------------
88 ;--------------------------------
90 SetCompressor /SOLID LZMA
91 SetCompressorDictSize 64
93 #!packhdr "$%TEMP%\exehead.tmp" '"${X264_UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"'
96 ;--------------------------------
98 ;--------------------------------
100 ReserveFile "${NSISDIR}\Plugins\Aero.dll"
101 ReserveFile "${NSISDIR}\Plugins\LangDLL.dll"
102 ReserveFile "${NSISDIR}\Plugins\LockedList.dll"
103 ReserveFile "${NSISDIR}\Plugins\LockedList64.dll"
104 ReserveFile "${NSISDIR}\Plugins\nsDialogs.dll"
105 ReserveFile "${NSISDIR}\Plugins\nsExec.dll"
106 ReserveFile "${NSISDIR}\Plugins\StartMenu.dll"
107 ReserveFile "${NSISDIR}\Plugins\StdUtils.dll"
108 ReserveFile "${NSISDIR}\Plugins\System.dll"
109 ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
112 ;--------------------------------
114 ;--------------------------------
117 Var UpdateNotificationShown
120 ;--------------------------------
122 ;--------------------------------
124 !searchreplace PRODUCT_VERSION_DATE "${X264_DATE}" "-" "."
125 VIProductVersion "${PRODUCT_VERSION_DATE}.${X264_BUILD}"
127 VIAddVersionKey "Author" "LoRd_MuldeR <mulder2@gmx.de>"
128 VIAddVersionKey "Comments" "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version."
129 VIAddVersionKey "CompanyName" "Free Software Foundation"
130 VIAddVersionKey "FileDescription" "Simple x264 Launcher [Build #${X264_BUILD}]"
131 VIAddVersionKey "FileVersion" "${PRODUCT_VERSION_DATE}.${X264_BUILD}"
132 VIAddVersionKey "LegalCopyright" "Copyright 2004-2016 LoRd_MuldeR"
133 VIAddVersionKey "LegalTrademarks" "GNU"
134 VIAddVersionKey "OriginalFilename" "x264_x64.${X264_DATE}.exe"
135 VIAddVersionKey "ProductName" "Simple x264 Launcher"
136 VIAddVersionKey "ProductVersion" "Build #${X264_BUILD} (${X264_DATE})"
137 VIAddVersionKey "Website" "${MyWebSite}"
140 ;--------------------------------
141 ;MUI2 Interface Settings
142 ;--------------------------------
144 !define MUI_ABORTWARNING
145 !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
146 !define MUI_STARTMENUPAGE_REGISTRY_KEY "${MyRegPath}"
147 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "StartmenuFolder"
148 !define MUI_LANGDLL_REGISTRY_ROOT HKLM
149 !define MUI_LANGDLL_REGISTRY_KEY "${MyRegPath}"
150 !define MUI_LANGDLL_REGISTRY_VALUENAME "SetupLanguage"
151 !define MUI_STARTMENUPAGE_DEFAULTFOLDER "Simple x264 Launcher v2"
152 !define MUI_FINISHPAGE_NOAUTOCLOSE
153 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
154 !define MUI_FINISHPAGE_RUN
155 !define MUI_FINISHPAGE_RUN_FUNCTION RunAppFunction
156 !define MUI_FINISHPAGE_SHOWREADME
157 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadmeFunction
158 !define MUI_FINISHPAGE_LINK ${MyWebSite}
159 !define MUI_FINISHPAGE_LINK_LOCATION ${MyWebSite}
160 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
161 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
162 !define MUI_WELCOMEFINISHPAGE_BITMAP "wizard.bmp"
163 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "wizard-un.bmp"
164 !define MUI_HEADERIMAGE
165 !define MUI_HEADERIMAGE_BITMAP "header.bmp"
166 !define MUI_HEADERIMAGE_UNBITMAP "header-un.bmp"
167 !define MUI_LANGDLL_ALLLANGUAGES
168 !define MUI_CUSTOMFUNCTION_GUIINIT MyGuiInit
169 !define MUI_CUSTOMFUNCTION_UNGUIINIT un.MyGuiInit
170 !define MUI_LANGDLL_ALWAYSSHOW
173 ;--------------------------------
174 ;MUI2 Pages (Installer)
175 ;--------------------------------
178 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
179 !define MUI_WELCOMEPAGE_TITLE_3LINES
180 !define MUI_FINISHPAGE_TITLE_3LINES
181 !insertmacro MUI_PAGE_WELCOME
184 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
185 !insertmacro MUI_PAGE_LICENSE "license.rtf"
188 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
189 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
190 !insertmacro MUI_PAGE_DIRECTORY
193 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
194 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
197 Page Custom LockedListShow
200 !insertmacro MUI_PAGE_INSTFILES
203 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
204 !insertmacro MUI_PAGE_FINISH
207 ;--------------------------------
208 ;MUI2 Pages (Uninstaller)
209 ;--------------------------------
212 !define MUI_WELCOMEPAGE_TITLE_3LINES
213 !define MUI_FINISHPAGE_TITLE_3LINES
214 !define MUI_PAGE_CUSTOMFUNCTION_PRE un.CheckForcedUninstall
215 !insertmacro MUI_UNPAGE_WELCOME
218 !define MUI_PAGE_CUSTOMFUNCTION_PRE un.CheckForcedUninstall
219 !insertmacro MUI_UNPAGE_CONFIRM
222 UninstPage Custom un.LockedListShow
225 !insertmacro MUI_UNPAGE_INSTFILES
228 !define MUI_PAGE_CUSTOMFUNCTION_PRE un.CheckForcedUninstall
229 !insertmacro MUI_UNPAGE_FINISH
232 ;--------------------------------
234 ;--------------------------------
236 !insertmacro MUI_LANGUAGE "English" ;first language is the default language
238 ; !insertmacro MUI_LANGUAGE "German"
239 ; !insertmacro MUI_LANGUAGE "Spanish"
240 ; !insertmacro MUI_LANGUAGE "Russian"
241 ; !insertmacro MUI_LANGUAGE "Ukrainian"
242 ; !insertmacro MUI_LANGUAGE "Polish"
244 ; !insertmacro MUI_LANGUAGE "French"
245 ; !insertmacro MUI_LANGUAGE "SpanishInternational"
246 ; !insertmacro MUI_LANGUAGE "SimpChinese"
247 ; !insertmacro MUI_LANGUAGE "TradChinese"
248 ; !insertmacro MUI_LANGUAGE "Japanese"
249 ; !insertmacro MUI_LANGUAGE "Italian"
250 ; !insertmacro MUI_LANGUAGE "Dutch"
251 ; !insertmacro MUI_LANGUAGE "Greek"
252 ; !insertmacro MUI_LANGUAGE "Hungarian"
253 ; !insertmacro MUI_LANGUAGE "Romanian"
254 ; !insertmacro MUI_LANGUAGE "Serbian"
255 ; !insertmacro MUI_LANGUAGE "SerbianLatin"
256 ; !insertmacro MUI_LANGUAGE "Arabic"
257 ; !insertmacro MUI_LANGUAGE "Portuguese"
258 ; !insertmacro MUI_LANGUAGE "Afrikaans"
259 ; !insertmacro MUI_LANGUAGE "Malay"
260 ; !insertmacro MUI_LANGUAGE "Indonesian"
263 ;--------------------------------
265 ;--------------------------------
268 !include "language\en.nsh"
271 ;--------------------------------
273 ;--------------------------------
275 !macro _UnattendedMode _a _b _t _f
276 !insertmacro _LOGICLIB_TEMP
277 ${StdUtils.TestParameter} $_LOGICLIB_TEMP "Update"
278 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
280 !define UnattendedMode `"" UnattendedMode ""`
282 !macro _ForcedMode _a _b _t _f
283 !insertmacro _LOGICLIB_TEMP
284 ${StdUtils.TestParameter} $_LOGICLIB_TEMP "Force"
285 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
287 !define ForcedMode `"" ForcedMode ""`
289 !macro _ValidFileName _a _b _t _f
290 !insertmacro _LOGICLIB_TEMP
291 ${StdUtils.ValidFileName} $_LOGICLIB_TEMP `${_b}`
292 StrCmp "$_LOGICLIB_TEMP" "ok" `${_t}` `${_f}`
294 !define ValidFileName `"" ValidFileName`
297 ;--------------------------------
298 ;Installer initialization
299 ;--------------------------------
306 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
309 MessageBox MB_ICONSTOP|MB_TOPMOST "Sorry, the installer is already running!"
315 # Running on Windows NT family?
317 MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, this application does *not* support Windows 9x or Windows ME!"
318 ExecShell "open" "http://windows.microsoft.com/"
322 # Running on Windows XP or later?
323 ${If} ${AtMostWin2000}
324 MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, but your operating system is *not* supported anymore.$\nInstallation will be aborted!$\n$\nThe minimum required platform is Windows XP (Service Pack 3)."
325 ExecShell "open" "http://windows.microsoft.com/"
329 # If on Windows XP, is the required Service Pack installed?
331 ${IfNot} ${RunningX64} # Windows XP 32-Bit, requires Service Pack 3
332 ${AndIf} ${AtMostServicePack} 2
333 MessageBox MB_TOPMOST|MB_ICONEXCLAMATION "This application requires Windows XP with Service Pack 3 installed.$\nWindows XP *without* Service Pack 3 reached end-of-life on 2010-07-13.$\nCurrent Windows XP (Service Pack 3) will be supported until 2014-04-08.$\n$\nPlease install Service Pack 3 now or just run Windows Update!"
334 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 3 for Windows XP now?" IDYES`
335 ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=24"
337 ExecShell "open" "http://windowsupdate.microsoft.com/"
341 ${If} ${RunningX64} # Windows XP 64-Bit, requires Service Pack 2
342 ${AndIf} ${AtMostServicePack} 1
343 MessageBox MB_TOPMOST|MB_ICONEXCLAMATION "This application requires Windows XP x64 Edition with Service Pack 2 installed.$\nWindows XP x64 Edition *without* Service Pack 2 reached end-of-life on 2009-04-14.$\nCurrent Windows XP x64 Edition (Service Pack 2) will be supported until 2014-04-08.$\n$\nPlease install Service Pack 2 now or just run Windows Update!"
344 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 2 for Windows XP x64 Edition now?" IDYES`
345 ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=17791"
347 ExecShell "open" "http://windowsupdate.microsoft.com/"
355 ${IfNot} ${UnattendedMode}
356 !insertmacro MUI_LANGDLL_DISPLAY
361 UserInfo::GetAccountType
364 MessageBox MB_ICONSTOP|MB_TOPMOST "Your system requires administrative permissions in order to install this software."
365 SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
371 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
374 MessageBox MB_ICONSTOP|MB_TOPMOST "Sorry, the un-installer is already running!"
378 ${IfNot} ${ForcedMode}
379 !insertmacro MUI_LANGDLL_DISPLAY
384 UserInfo::GetAccountType
387 MessageBox MB_ICONSTOP|MB_TOPMOST "Your system requires administrative permissions in order to install this software."
388 SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
394 ;--------------------------------
396 ;--------------------------------
399 StrCpy $0 $HWNDPARENT
400 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
404 Function un.MyGuiInit
405 StrCpy $0 $HWNDPARENT
406 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
411 ;--------------------------------
412 ;Macros & Auxiliary Functions
413 ;--------------------------------
415 !macro PrintProgress Text
416 SetDetailsPrint textonly
417 DetailPrint '${Text}'
418 SetDetailsPrint listonly
422 !macro CreateWebLink ShortcutFile TargetURL
425 StrCpy $0 "${ShortcutFile}"
426 StrCpy $1 "${TargetURL}"
432 Function _CreateWebLink
434 SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL
435 DeleteINISec "$0" "DEFAULT"
436 DeleteINISec "$0" "InternetShortcut"
437 WriteINIStr "$0" "DEFAULT" "BASEURL" "$1"
438 WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1"
439 WriteINIStr "$0" "InternetShortcut" "URL" "$1"
440 WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll"
441 WriteINIStr "$0" "InternetShortcut" "IconIndex" "150"
443 SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY
446 !macro GetExecutableName OutVar
447 ${StdUtils.GetParameter} ${OutVar} "Update" ""
448 ${StdUtils.TrimStr} ${OutVar}
449 ${If} "${OutVar}" == ""
450 ${OrIfNot} ${ValidFileName} "${OutVar}"
451 StrCpy ${OutVar} "x264_launcher.exe"
455 !macro DisableNextButton TmpVar
456 GetDlgItem ${TmpVar} $HWNDPARENT 1
457 EnableWindow ${TmpVar} 0
460 !macro DisableBackButton TmpVar
461 GetDlgItem ${TmpVar} $HWNDPARENT 3
462 EnableWindow ${TmpVar} 0
465 !macro CleanUpFiles options
466 Delete ${options} `$INSTDIR\*.exe`
467 Delete ${options} `$INSTDIR\*.dll`
468 Delete ${options} `$INSTDIR\*.txt`
469 Delete ${options} `$INSTDIR\*.htm`
470 Delete ${options} `$INSTDIR\*.html`
472 RMDir /r ${options} `$INSTDIR\toolset`
473 RMDir /r ${options} `$INSTDIR\imageformats`
474 RMDir /r ${options} `$INSTDIR\sources`
477 !macro SetControlEnabled item_id enable
478 FindWindow $R0 "#32770" "" $HWNDPARENT
480 GetDlgItem $R1 $R0 ${item_id}
481 EnableWindow $R1 ${enable}
485 !macro SkipToNextPage
486 GetDlgItem $R0 $HWNDPARENT 1
487 System::Call "User32::PostMessage(i $HWNDPARENT, i ${WM_COMMAND}, i 1, i $R0)"
491 ;--------------------------------
493 ;--------------------------------
496 SetShellVarContext all
497 SetOutPath "$INSTDIR"
500 Section "-Clean Up Old Cruft"
501 !insertmacro PrintProgress "$(X264_LANG_STATUS_CLEANUP)"
502 !insertmacro CleanUpFiles ""
505 Section "!Install Files"
506 !insertmacro PrintProgress "$(X264_LANG_STATUS_INSTFILES)"
509 !insertmacro GetExecutableName $R0
511 Delete "$INSTDIR\$R0"
514 MessageBox MB_TOPMOST|MB_ICONSTOP|MB_RETRYCANCEL 'Could not delete old "$R0" file. Is program still running?' IDRETRY DeleteOldBinary
515 Abort "Could not delete old binary!"
518 File /a `/oname=$R0` `${X264_SOURCE_PATH}\x264_launcher.exe`
520 File /a `${X264_SOURCE_PATH}\*.dll`
521 File /a `${X264_SOURCE_PATH}\*.txt`
522 File /a `${X264_SOURCE_PATH}\*.html`
524 SetOutPath "$INSTDIR\imageformats"
525 File /a /r `${X264_SOURCE_PATH}\imageformats\*.*`
527 SetOutPath "$INSTDIR\toolset"
528 File /a /r `${X264_SOURCE_PATH}\toolset\*.*`
530 SetOutPath "$INSTDIR\sources"
531 File /a /r `${X264_SOURCE_PATH}\sources\*.*`
534 Section "-Write Uinstaller"
535 !insertmacro PrintProgress "$(X264_LANG_STATUS_MAKEUNINST)"
536 WriteUninstaller "$INSTDIR\Uninstall.exe"
539 Section "-Create Shortcuts"
540 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
541 !insertmacro PrintProgress "$(X264_LANG_STATUS_SHORTCUTS)"
542 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
544 SetShellVarContext current
546 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
547 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
548 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
550 SetShellVarContext all
552 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
553 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
554 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
556 !insertmacro GetExecutableName $R0
558 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" "$INSTDIR\$R0" "" "$INSTDIR\$R0" 0
559 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_LICENSE).lnk" "$INSTDIR\LICENSE.html"
560 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_MANUAL).lnk" "$INSTDIR\README.html"
561 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_CHANGELOG).lnk" "$INSTDIR\HISTORY.txt"
562 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_UNINSTALL).lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
564 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\MuldeR's Homepage.url" "${MyWebSite}"
565 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Doom9's Forum.url" "http://forum.doom9.org/"
566 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\x264.com.url" "http://x264.com/"
567 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\x265.com.url" "http://x265.org/"
568 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\Avisynth Wiki.url" "http://avisynth.nl/"
569 !insertmacro CreateWebLink "$SMPROGRAMS\$StartMenuFolder\VapourSynth.com.url" "http://www.vapoursynth.com/"
571 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk"
572 ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils.Const.ISV_PinToTaskbar}
573 DetailPrint 'Pin: "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" -> $R1'
575 !insertmacro MUI_STARTMENU_WRITE_END
578 Section "-Update Registry"
579 !insertmacro PrintProgress "$(X264_LANG_STATUS_REGISTRY)"
581 !insertmacro GetExecutableName $R0
582 WriteRegStr HKLM "${MyRegPath}" "InstallLocation" "$INSTDIR"
583 WriteRegStr HKLM "${MyRegPath}" "ExecutableName" "$R0"
584 WriteRegStr HKLM "${MyRegPath}" "DisplayIcon" "$INSTDIR\$R0,0"
585 WriteRegStr HKLM "${MyRegPath}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
586 WriteRegStr HKLM "${MyRegPath}" "DisplayName" "Simple x264 Launcher v2"
587 WriteRegStr HKLM "${MyRegPath}" "Publisher" "LoRd_MuldeR <mulder2@gmx.de>"
588 WriteRegStr HKLM "${MyRegPath}" "DisplayVersion" "Build #${X264_BUILD} (${X264_DATE})"
589 WriteRegStr HKLM "${MyRegPath}" "URLInfoAbout" "${MyWebSite}"
590 WriteRegStr HKLM "${MyRegPath}" "URLUpdateInfo" "${MyWebSite}"
592 WriteRegStr HKLM "${AppPaths}\x264_launcher.exe" "" "$INSTDIR\$R0"
593 WriteRegStr HKLM "${AppPaths}\x264_launcher.exe" "Path" "$INSTDIR"
597 !insertmacro PrintProgress "$(MUI_TEXT_FINISH_TITLE)."
598 ${IfThen} ${UnattendedMode} ${|} SetAutoClose true ${|}
602 ;--------------------------------
604 ;--------------------------------
608 !insertmacro PrintProgress "$(X264_LANG_STATUS_UNINSTALL)"
614 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
615 ${IfNot} "$StartMenuFolder" == ""
616 SetShellVarContext current
617 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk"
618 ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils.Const.ISV_UnpinFromTaskbar}
619 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" -> $R1'
621 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
622 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.lnk"
623 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.url"
624 RMDir "$SMPROGRAMS\$StartMenuFolder"
627 SetShellVarContext all
628 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk"
629 ${StdUtils.InvokeShellVerb} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils.Const.ISV_UnpinFromTaskbar}
630 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" -> $R1'
632 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
633 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.lnk"
634 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuFolder\*.url"
635 RMDir "$SMPROGRAMS\$StartMenuFolder"
643 ReadRegStr $R0 HKLM "${MyRegPath}" "ExecutableName"
644 ${IfThen} "$R0" == "" ${|} StrCpy $R0 "x264_launcher.exe" ${|}
646 Delete /REBOOTOK "$INSTDIR\$R0"
647 !insertmacro CleanUpFiles /REBOOTOK
654 DeleteRegKey HKLM "${MyRegPath}"
655 DeleteRegKey HKCU "${MyRegPath}"
657 DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
658 DeleteRegKey HKCU "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
660 DeleteRegKey HKLM "${AppPaths}\x264_launcher.exe"
661 DeleteRegKey HKCU "${AppPaths}\x264_launcherexe"
663 MessageBox MB_YESNO|MB_TOPMOST "$(X264_LANG_UNINST_PERSONAL)" IDNO +3
664 Delete "$LOCALAPPDATA\LoRd_MuldeR\Simple x264 Launcher\*.ini"
665 RMDir "$LOCALAPPDATA\LoRd_MuldeR\Simple x264 Launcher"
667 !insertmacro PrintProgress "$(MUI_UNTEXT_FINISH_TITLE)."
671 ;--------------------------------
672 ;Check For Update Mode
673 ;--------------------------------
675 Function SkipIfUnattended
676 ${IfThen} ${UnattendedMode} ${|} Abort ${|}
679 Function CheckForUpdate
680 ${If} "$INSTDIR" == ""
681 ${OrIf} "$INSTDIR" == "$EXEDIR"
682 ${OrIfNot} ${FileExists} "$INSTDIR\x264_launcher.exe"
683 StrCpy $UpdateNotificationShown FALSE
684 !insertmacro SetControlEnabled 1019 1
685 !insertmacro SetControlEnabled 1001 1
688 !insertmacro SetControlEnabled 1019 0
689 !insertmacro SetControlEnabled 1001 0
690 ${If} "$UpdateNotificationShown" != TRUE
691 StrCpy $UpdateNotificationShown TRUE
692 MessageBox MB_ICONINFORMATION|MB_TOPMOST "$(X264_LANG_UNINST_UPDATE_MODE)"
693 !insertmacro SkipToNextPage
698 Function un.CheckForcedUninstall
699 ${IfThen} ${ForcedMode} ${|} Abort ${|}
703 ;--------------------------------
705 ;--------------------------------
707 !macro _LockedListShow uinst
708 !insertmacro MUI_HEADER_TEXT "$(X264_LANG_LOCKEDLIST_HEADER)" "$(X264_LANG_LOCKEDLIST_TEXT)"
709 ${If} ${UnattendedMode}
710 !insertmacro DisableBackButton $R0
714 File /oname=$PLUGINSDIR\LockedList64.dll `${NSISDIR}\Plugins\LockedList64.dll`
716 !insertmacro GetExecutableName $R0
717 LockedList::AddModule "\$R0"
718 ${If} "$R0" != "x264_launcher.exe"
719 LockedList::AddModule "\x264_launcher.exe"
721 LockedList::AddModule "\Uninstall.exe"
723 LockedList::AddModule "\Au_.exe"
725 LockedList::AddFolder "$INSTDIR"
726 LockedList::Dialog /autonext /heading "$(X264_LANG_LOCKEDLIST_HEADING)" /noprograms "$(X264_LANG_LOCKEDLIST_NOPROG)" /searching "$(X264_LANG_LOCKEDLIST_SEARCH)" /colheadings "$(X264_LANG_LOCKEDLIST_COLHDR1)" "$(X264_LANG_LOCKEDLIST_COLHDR2)"
730 Function LockedListShow
731 !insertmacro _LockedListShow 0
734 Function un.LockedListShow
735 !insertmacro _LockedListShow 1
739 ;--------------------------------
741 ;--------------------------------
743 Function RunAppFunction
744 !insertmacro DisableNextButton $R0
745 !insertmacro GetExecutableName $R0
746 ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR" "explore" ""
747 ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR\$R0" "open" "--first-run"
750 Function ShowReadmeFunction
751 !insertmacro DisableNextButton $R0
752 ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR\README.html" "open" ""
755 Function .onInstSuccess
756 ${If} ${UnattendedMode}
757 !insertmacro GetExecutableName $R0
758 ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR" "explore" ""
759 ${StdUtils.ExecShellAsUser} $R1 "$INSTDIR\$R0" "open" "--first-run"