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 !define AppPaths
"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
57 ;--------------------------------
59 ;--------------------------------
62 !packhdr "${PACKHDRTEMP}" '"..\mt.exe" -manifest "setup.manifest" -outputresource:"${PACKHDRTEMP};1"'
65 ;--------------------------------
67 ;--------------------------------
72 !include `StdUtils.nsh`
75 ;--------------------------------
77 ;--------------------------------
79 RequestExecutionLevel admin
81 ShowUninstDetails show
82 Name "Simple x264/x265 Launcher [Build #${X264_BUILD}]"
83 OutFile "${X264_OUTPUT_FILE}"
84 BrandingText "Date created: ${X264_DATE} [Build #${X264_BUILD}]"
85 InstallDir "$PROGRAMFILES\MuldeR\Simple x264 Launcher v2"
86 InstallDirRegKey HKLM "${MyRegPath}" "InstallLocation"
89 ;--------------------------------
91 ;--------------------------------
93 SetCompressor
/SOLID LZMA
94 SetCompressorDictSize
64
96 !packhdr "$%TEMP%\exehead.tmp" '"${X264_UPX_PATH}" --brute "$%TEMP%\exehead.tmp"'
99 ;--------------------------------
101 ;--------------------------------
103 ReserveFile
"${NSISDIR}\Plugins\Aero.dll"
104 ReserveFile
"${NSISDIR}\Plugins\LangDLL.dll"
105 ReserveFile
"${NSISDIR}\Plugins\LockedList.dll"
106 ReserveFile
"${NSISDIR}\Plugins\LockedList64.dll"
107 ReserveFile
"${NSISDIR}\Plugins\nsDialogs.dll"
108 ReserveFile
"${NSISDIR}\Plugins\nsExec.dll"
109 ReserveFile
"${NSISDIR}\Plugins\StartMenu.dll"
110 ReserveFile
"${NSISDIR}\Plugins\StdUtils.dll"
111 ReserveFile
"${NSISDIR}\Plugins\System.dll"
112 ReserveFile
"${NSISDIR}\Plugins\UserInfo.dll"
115 ;--------------------------------
117 ;--------------------------------
120 Var UpdateNotificationShown
123 ;--------------------------------
125 ;--------------------------------
127 !searchreplace PRODUCT_VERSION_DATE
"${X264_DATE}" "-" "."
128 VIProductVersion
"${PRODUCT_VERSION_DATE}.${X264_BUILD}"
130 VIAddVersionKey
"Author" "LoRd_MuldeR <mulder2@gmx.de>"
131 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."
132 VIAddVersionKey
"CompanyName" "Free Software Foundation"
133 VIAddVersionKey
"FileDescription" "Simple x264 Launcher [Build #${X264_BUILD}]"
134 VIAddVersionKey
"FileVersion" "${PRODUCT_VERSION_DATE}.${X264_BUILD}"
135 VIAddVersionKey
"LegalCopyright" "Copyright 2004-2016 LoRd_MuldeR"
136 VIAddVersionKey
"LegalTrademarks" "GNU"
137 VIAddVersionKey
"OriginalFilename" "x264_x64.${X264_DATE}.exe"
138 VIAddVersionKey
"ProductName" "Simple x264 Launcher"
139 VIAddVersionKey
"ProductVersion" "Build #${X264_BUILD} (${X264_DATE})"
140 VIAddVersionKey
"Website" "${MyWebSite}"
143 ;--------------------------------
144 ;MUI2 Interface Settings
145 ;--------------------------------
147 !define MUI_ABORTWARNING
148 !define MUI_STARTMENUPAGE_REGISTRY_ROOT
HKLM
149 !define MUI_STARTMENUPAGE_REGISTRY_KEY
"${MyRegPath}"
150 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME
"StartmenuFolder"
151 !define MUI_LANGDLL_REGISTRY_ROOT
HKLM
152 !define MUI_LANGDLL_REGISTRY_KEY
"${MyRegPath}"
153 !define MUI_LANGDLL_REGISTRY_VALUENAME
"SetupLanguage"
154 !define MUI_STARTMENUPAGE_DEFAULTFOLDER
"Simple x264 Launcher v2"
155 !define MUI_FINISHPAGE_NOAUTOCLOSE
156 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
157 !define MUI_FINISHPAGE_RUN
158 !define MUI_FINISHPAGE_RUN_FUNCTION RunAppFunction
159 !define MUI_FINISHPAGE_SHOWREADME
160 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadmeFunction
161 !define MUI_FINISHPAGE_LINK
${MyWebSite}
162 !define MUI_FINISHPAGE_LINK_LOCATION
${MyWebSite}
163 !define MUI_ICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
164 !define MUI_UNICON
"${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
165 !define MUI_WELCOMEFINISHPAGE_BITMAP
"wizard.bmp"
166 !define MUI_UNWELCOMEFINISHPAGE_BITMAP
"wizard-un.bmp"
167 !define MUI_HEADERIMAGE
168 !define MUI_HEADERIMAGE_BITMAP
"header.bmp"
169 !define MUI_HEADERIMAGE_UNBITMAP
"header-un.bmp"
170 !define MUI_LANGDLL_ALLLANGUAGES
171 !define MUI_CUSTOMFUNCTION_GUIINIT MyGuiInit
172 !define MUI_CUSTOMFUNCTION_UNGUIINIT un
.MyGuiInit
173 !define MUI_LANGDLL_ALWAYSSHOW
176 ;--------------------------------
177 ;MUI2 Pages (Installer)
178 ;--------------------------------
181 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
182 !define MUI_WELCOMEPAGE_TITLE_3LINES
183 !define MUI_FINISHPAGE_TITLE_3LINES
184 !insertmacro MUI_PAGE_WELCOME
187 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
188 !insertmacro MUI_PAGE_LICENSE
"license.rtf"
191 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
192 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckForUpdate
193 !insertmacro MUI_PAGE_DIRECTORY
196 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
197 !insertmacro MUI_PAGE_STARTMENU Application
$StartMenuFolder
200 Page Custom LockedListShow
203 !insertmacro MUI_PAGE_INSTFILES
206 !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfUnattended
207 !insertmacro MUI_PAGE_FINISH
210 ;--------------------------------
211 ;MUI2 Pages (Uninstaller)
212 ;--------------------------------
215 !define MUI_WELCOMEPAGE_TITLE_3LINES
216 !define MUI_FINISHPAGE_TITLE_3LINES
217 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
218 !insertmacro MUI_UNPAGE_WELCOME
221 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
222 !insertmacro MUI_UNPAGE_CONFIRM
225 UninstPage Custom un
.LockedListShow
228 !insertmacro MUI_UNPAGE_INSTFILES
231 !define MUI_PAGE_CUSTOMFUNCTION_PRE un
.CheckForcedUninstall
232 !insertmacro MUI_UNPAGE_FINISH
235 ;--------------------------------
237 ;--------------------------------
239 !insertmacro MUI_LANGUAGE
"English" ;first language is the default language
241 ; !insertmacro MUI_LANGUAGE "German"
242 ; !insertmacro MUI_LANGUAGE "Spanish"
243 ; !insertmacro MUI_LANGUAGE "Russian"
244 ; !insertmacro MUI_LANGUAGE "Ukrainian"
245 ; !insertmacro MUI_LANGUAGE "Polish"
247 ; !insertmacro MUI_LANGUAGE "French"
248 ; !insertmacro MUI_LANGUAGE "SpanishInternational"
249 ; !insertmacro MUI_LANGUAGE "SimpChinese"
250 ; !insertmacro MUI_LANGUAGE "TradChinese"
251 ; !insertmacro MUI_LANGUAGE "Japanese"
252 ; !insertmacro MUI_LANGUAGE "Italian"
253 ; !insertmacro MUI_LANGUAGE "Dutch"
254 ; !insertmacro MUI_LANGUAGE "Greek"
255 ; !insertmacro MUI_LANGUAGE "Hungarian"
256 ; !insertmacro MUI_LANGUAGE "Romanian"
257 ; !insertmacro MUI_LANGUAGE "Serbian"
258 ; !insertmacro MUI_LANGUAGE "SerbianLatin"
259 ; !insertmacro MUI_LANGUAGE "Arabic"
260 ; !insertmacro MUI_LANGUAGE "Portuguese"
261 ; !insertmacro MUI_LANGUAGE "Afrikaans"
262 ; !insertmacro MUI_LANGUAGE "Malay"
263 ; !insertmacro MUI_LANGUAGE "Indonesian"
266 ;--------------------------------
268 ;--------------------------------
271 !include "language\en.nsh"
274 ;--------------------------------
276 ;--------------------------------
278 !macro _UnattendedMode _a _b _t _f
279 !insertmacro _LOGICLIB_TEMP
280 ${StdUtils
.TestParameter
} $_LOGICLIB_TEMP "Update"
281 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
283 !define UnattendedMode
`"" UnattendedMode ""`
285 !macro _ForcedMode _a _b _t _f
286 !insertmacro _LOGICLIB_TEMP
287 ${StdUtils
.TestParameter
} $_LOGICLIB_TEMP "Force"
288 StrCmp "$_LOGICLIB_TEMP" "true" `${_t}` `${_f}`
290 !define ForcedMode
`"" ForcedMode ""`
292 !macro _ValidFileName _a _b _t _f
293 !insertmacro _LOGICLIB_TEMP
294 ${StdUtils
.ValidFileName
} $_LOGICLIB_TEMP `${_b}`
295 StrCmp "$_LOGICLIB_TEMP" "ok" `${_t}` `${_f}`
297 !define ValidFileName
`"" ValidFileName`
300 ;--------------------------------
301 ;Installer initialization
302 ;--------------------------------
309 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
312 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the installer is already running!"
318 # Running on Windows NT family?
320 MessageBox MB_TOPMOST|
MB_ICONSTOP "Sorry, this application does *not* support Windows 9x or Windows ME!"
321 ExecShell "open" "http://windows.microsoft.com/"
325 # Running on Windows XP or later?
326 ${If} ${AtMostWin2000}
327 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)."
328 ExecShell "open" "http://windows.microsoft.com/"
332 # If on Windows XP, is the required Service Pack installed?
334 ${IfNot} ${RunningX64} # Windows XP 32-Bit, requires Service Pack 3
335 ${AndIf} ${AtMostServicePack} 2
336 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!"
337 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 3 for Windows XP now?" IDYES`
338 ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=24"
340 ExecShell "open" "http://windowsupdate.microsoft.com/"
344 ${If} ${RunningX64} # Windows XP 64-Bit, requires Service Pack 2
345 ${AndIf} ${AtMostServicePack} 1
346 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!"
347 ${If} ${Cmd} `MessageBox MB_TOPMOST|MB_ICONQUESTION|MB_YESNO "Do you want to download Service Pack 2 for Windows XP x64 Edition now?" IDYES`
348 ExecShell "open" "http://www.microsoft.com/en-us/download/details.aspx?id=17791"
350 ExecShell "open" "http://windowsupdate.microsoft.com/"
358 ${IfNot} ${UnattendedMode}
359 !insertmacro MUI_LANGDLL_DISPLAY
364 UserInfo::GetAccountType
367 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
368 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
374 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{2B3D1EBF-B3B6-4E93-92B9-6853029A7162}") i .r1 ?e'
377 MessageBox MB_ICONSTOP|
MB_TOPMOST "Sorry, the un-installer is already running!"
381 ${IfNot} ${ForcedMode}
382 !insertmacro MUI_LANGDLL_DISPLAY
387 UserInfo::GetAccountType
390 MessageBox MB_ICONSTOP|
MB_TOPMOST "Your system requires administrative permissions in order to install this software."
391 SetErrorLevel
740 ;ERROR_ELEVATION_REQUIRED
397 ;--------------------------------
399 ;--------------------------------
402 StrCpy $0 $HWNDPARENT
403 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
407 Function un
.MyGuiInit
408 StrCpy $0 $HWNDPARENT
409 System::Call "user32::SetWindowPos(i r0, i -1, i 0, i 0, i 0, i 0, i 3)"
414 ;--------------------------------
415 ;Macros & Auxiliary Functions
416 ;--------------------------------
418 !macro PrintProgress Text
419 SetDetailsPrint textonly
420 DetailPrint '${Text}'
421 SetDetailsPrint listonly
425 !macro CreateWebLink ShortcutFile TargetURL
428 StrCpy $0 "${ShortcutFile}"
429 StrCpy $1 "${TargetURL}"
435 Function _CreateWebLink
437 SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL
438 DeleteINISec "$0" "DEFAULT"
439 DeleteINISec "$0" "InternetShortcut"
440 WriteINIStr "$0" "DEFAULT" "BASEURL" "$1"
441 WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1"
442 WriteINIStr "$0" "InternetShortcut" "URL" "$1"
443 WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll"
444 WriteINIStr "$0" "InternetShortcut" "IconIndex" "150"
446 SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY
449 !macro GetExecutableName OutVar
450 ${StdUtils
.GetParameter
} ${OutVar} "Update" ""
451 ${StdUtils
.TrimStr
} ${OutVar}
452 ${If} "${OutVar}" ==
""
453 ${OrIfNot} ${ValidFileName} "${OutVar}"
454 StrCpy ${OutVar} "x264_launcher.exe"
458 !macro DisableNextButton TmpVar
459 GetDlgItem
${TmpVar} $HWNDPARENT 1
460 EnableWindow
${TmpVar} 0
463 !macro DisableBackButton TmpVar
464 GetDlgItem
${TmpVar} $HWNDPARENT 3
465 EnableWindow
${TmpVar} 0
468 !macro CleanUpFiles options
469 Delete ${options} `$INSTDIR\*.exe`
470 Delete ${options} `$INSTDIR\*.dll`
471 Delete ${options} `$INSTDIR\*.txt`
472 Delete ${options} `$INSTDIR\*.htm`
473 Delete ${options} `$INSTDIR\*.html`
475 RMDir /r
${options} `$INSTDIR\toolset`
476 RMDir /r
${options} `$INSTDIR\imageformats`
477 RMDir /r
${options} `$INSTDIR\sources`
480 !macro SetControlEnabled item_id enable
481 FindWindow $R0 "#32770" "" $HWNDPARENT
483 GetDlgItem
$R1 $R0 ${item_id}
484 EnableWindow
$R1 ${enable}
488 !macro SkipToNextPage
489 GetDlgItem
$R0 $HWNDPARENT 1
490 System::Call "User32::PostMessage(i $HWNDPARENT, i ${WM_COMMAND}, i 1, i $R0)"
494 ;--------------------------------
496 ;--------------------------------
499 SetShellVarContext all
500 SetOutPath "$INSTDIR"
503 Section "-Clean Up Old Cruft"
504 !insertmacro PrintProgress
"$(X264_LANG_STATUS_CLEANUP)"
505 !insertmacro CleanUpFiles
""
508 Section "!Install Files"
509 !insertmacro PrintProgress
"$(X264_LANG_STATUS_INSTFILES)"
512 !insertmacro GetExecutableName
$R0
514 Delete "$INSTDIR\$R0"
517 MessageBox MB_TOPMOST|
MB_ICONSTOP|
MB_RETRYCANCEL 'Could not delete old "$R0" file. Is program still running?' IDRETRY DeleteOldBinary
518 Abort "Could not delete old binary!"
521 File /a
`/oname=$R0` `${X264_SOURCE_PATH}\x264_launcher.exe`
523 File /a
`${X264_SOURCE_PATH}\*.dll`
524 File /a
`${X264_SOURCE_PATH}\*.txt`
525 File /a
`${X264_SOURCE_PATH}\*.html`
527 SetOutPath "$INSTDIR\imageformats"
528 File /a
/r
`${X264_SOURCE_PATH}\imageformats\*.*`
530 SetOutPath "$INSTDIR\toolset"
531 File /a
/r
`${X264_SOURCE_PATH}\toolset\*.*`
533 SetOutPath "$INSTDIR\sources"
534 File /a
/r
`${X264_SOURCE_PATH}\sources\*.*`
537 Section "-Write Uinstaller"
538 !insertmacro PrintProgress
"$(X264_LANG_STATUS_MAKEUNINST)"
539 WriteUninstaller "$INSTDIR\Uninstall.exe"
542 Section "-Create Shortcuts"
543 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
544 !insertmacro PrintProgress
"$(X264_LANG_STATUS_SHORTCUTS)"
545 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
547 SetShellVarContext current
549 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
550 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
551 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
553 SetShellVarContext all
555 Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
556 Delete "$SMPROGRAMS\$StartMenuFolder\*.pif"
557 Delete "$SMPROGRAMS\$StartMenuFolder\*.url"
559 !insertmacro GetExecutableName
$R0
561 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" "$INSTDIR\$R0" "" "$INSTDIR\$R0" 0
562 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_LICENSE).lnk" "$INSTDIR\LICENSE.html"
563 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_MANUAL).lnk" "$INSTDIR\README.html"
564 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_CHANGELOG).lnk" "$INSTDIR\HISTORY.txt"
565 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(X264_LANG_LINK_UNINSTALL).lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
567 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\MuldeR's Homepage.url" "${MyWebSite}"
568 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Doom9's Forum.url" "http://forum.doom9.org/"
569 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\x264.com.url" "http://x264.com/"
570 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\x265.com.url" "http://x265.org/"
571 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\Avisynth Wiki.url" "http://avisynth.nl/"
572 !insertmacro CreateWebLink
"$SMPROGRAMS\$StartMenuFolder\VapourSynth.com.url" "http://www.vapoursynth.com/"
574 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk"
575 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils
.Const
.ShellVerb
.PinToTaskbar
}
576 DetailPrint 'Pin: "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" -> $R1'
578 !insertmacro MUI_STARTMENU_WRITE_END
581 Section "-Update Registry"
582 !insertmacro PrintProgress
"$(X264_LANG_STATUS_REGISTRY)"
584 !insertmacro GetExecutableName
$R0
585 WriteRegStr HKLM "${MyRegPath}" "InstallLocation" "$INSTDIR"
586 WriteRegStr HKLM "${MyRegPath}" "ExecutableName" "$R0"
587 WriteRegStr HKLM "${MyRegPath}" "DisplayIcon" "$INSTDIR\$R0,0"
588 WriteRegStr HKLM "${MyRegPath}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
589 WriteRegStr HKLM "${MyRegPath}" "DisplayName" "Simple x264 Launcher v2"
590 WriteRegStr HKLM "${MyRegPath}" "Publisher" "LoRd_MuldeR <mulder2@gmx.de>"
591 WriteRegStr HKLM "${MyRegPath}" "DisplayVersion" "Build #${X264_BUILD} (${X264_DATE})"
592 WriteRegStr HKLM "${MyRegPath}" "URLInfoAbout" "${MyWebSite}"
593 WriteRegStr HKLM "${MyRegPath}" "URLUpdateInfo" "${MyWebSite}"
595 DeleteRegKey HKCU "${AppPaths}\x264_launcher.exe"
596 WriteRegStr HKLM "${AppPaths}\x264_launcher.exe" "" "$INSTDIR\$R0"
597 WriteRegStr HKLM "${AppPaths}\x264_launcher.exe" "Path" "$INSTDIR"
601 !insertmacro PrintProgress
"$(MUI_TEXT_FINISH_TITLE)."
602 ${IfThen} ${UnattendedMode} ${|
} SetAutoClose true
${|
}
606 ;--------------------------------
608 ;--------------------------------
612 !insertmacro PrintProgress
"$(X264_LANG_STATUS_UNINSTALL)"
618 !insertmacro MUI_STARTMENU_GETFOLDER Application
$StartMenuFolder
619 ${IfNot} "$StartMenuFolder" ==
""
620 SetShellVarContext current
621 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk"
622 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils
.Const
.ShellVerb
.UnpinFromTaskbar
}
623 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" -> $R1'
625 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
626 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
627 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
628 RMDir "$SMPROGRAMS\$StartMenuFolder"
631 SetShellVarContext all
632 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk"
633 ${StdUtils
.InvokeShellVerb
} $R1 "$SMPROGRAMS\$StartMenuFolder" "Simple x264 Launcher.lnk" ${StdUtils
.Const
.ShellVerb
.UnpinFromTaskbar
}
634 DetailPrint 'Unpin: "$SMPROGRAMS\$StartMenuFolder\Simple x264 Launcher.lnk" -> $R1'
636 ${If} ${FileExists} "$SMPROGRAMS\$StartMenuFolder\*.*"
637 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.lnk"
638 Delete /REBOOTOK
"$SMPROGRAMS\$StartMenuFolder\*.url"
639 RMDir "$SMPROGRAMS\$StartMenuFolder"
647 ReadRegStr $R0 HKLM "${MyRegPath}" "ExecutableName"
648 ${IfThen} "$R0" ==
"" ${|
} StrCpy $R0 "x264_launcher.exe" ${|
}
650 Delete /REBOOTOK
"$INSTDIR\$R0"
651 !insertmacro CleanUpFiles
/REBOOTOK
658 DeleteRegKey HKLM "${MyRegPath}"
659 DeleteRegKey HKCU "${MyRegPath}"
661 DeleteRegKey HKLM "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
662 DeleteRegKey HKCU "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{54dcbccb-c905-46dc-b6e6-48563d0e9e55}"
664 DeleteRegKey HKLM "${AppPaths}\x264_launcher.exe"
665 DeleteRegKey HKCU "${AppPaths}\x264_launcher.exe"
667 MessageBox MB_YESNO|
MB_TOPMOST "$(X264_LANG_UNINST_PERSONAL)" IDNO +3
668 Delete "$LOCALAPPDATA\LoRd_MuldeR\Simple x264 Launcher\*.ini"
669 RMDir "$LOCALAPPDATA\LoRd_MuldeR\Simple x264 Launcher"
671 !insertmacro PrintProgress
"$(MUI_UNTEXT_FINISH_TITLE)."
675 ;--------------------------------
676 ;Check For Update Mode
677 ;--------------------------------
679 Function SkipIfUnattended
680 ${IfThen} ${UnattendedMode} ${|
} Abort ${|
}
683 Function CheckForUpdate
684 ${If} "$INSTDIR" ==
""
685 ${OrIf} "$INSTDIR" ==
"$EXEDIR"
686 ${OrIfNot} ${FileExists} "$INSTDIR\x264_launcher.exe"
687 StrCpy $UpdateNotificationShown FALSE
688 !insertmacro SetControlEnabled
1019 1
689 !insertmacro SetControlEnabled
1001 1
692 !insertmacro SetControlEnabled
1019 0
693 !insertmacro SetControlEnabled
1001 0
694 ${If} "$UpdateNotificationShown" != TRUE
695 StrCpy $UpdateNotificationShown TRUE
696 MessageBox MB_ICONINFORMATION|
MB_TOPMOST "$(X264_LANG_UNINST_UPDATE_MODE)"
697 !insertmacro SkipToNextPage
702 Function un
.CheckForcedUninstall
703 ${IfThen} ${ForcedMode} ${|
} Abort ${|
}
707 ;--------------------------------
709 ;--------------------------------
711 !macro _LockedListShow uinst
712 !insertmacro MUI_HEADER_TEXT
"$(X264_LANG_LOCKEDLIST_HEADER)" "$(X264_LANG_LOCKEDLIST_TEXT)"
713 ${If} ${UnattendedMode}
714 !insertmacro DisableBackButton
$R0
718 File /oname=
$PLUGINSDIR\LockedList64
.dll
`${NSISDIR}\Plugins\LockedList64.dll`
720 !insertmacro GetExecutableName
$R0
721 LockedList::AddModule
"\$R0"
722 ${If} "$R0" !=
"x264_launcher.exe"
723 LockedList::AddModule
"\x264_launcher.exe"
725 LockedList::AddModule
"\Uninstall.exe"
727 LockedList::AddModule
"\Au_.exe"
729 #LockedList::AddFolder "$INSTDIR"
730 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)"
734 Function LockedListShow
735 !insertmacro _LockedListShow
0
738 Function un
.LockedListShow
739 !insertmacro _LockedListShow
1
743 ;--------------------------------
745 ;--------------------------------
747 Function RunAppFunction
748 !insertmacro DisableNextButton
$R0
749 !insertmacro GetExecutableName
$R0
750 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR" "explore" ""
751 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\$R0" "open" "--first-run"
754 Function ShowReadmeFunction
755 !insertmacro DisableNextButton
$R0
756 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\README.html" "open" ""
759 Function .onInstSuccess
760 ${If} ${UnattendedMode}
761 !insertmacro GetExecutableName
$R0
762 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR" "explore" ""
763 ${StdUtils
.ExecShellAsUser
} $R1 "$INSTDIR\$R0" "open" "--first-run"