-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Christopher Gurnee
committed
Dec 7, 2014
1 parent
5d426c4
commit fb67c7f
Showing
3 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
/obj.x86-32/ | ||
/bin.x86-64/ | ||
/obj.x86-64/ | ||
/installer/*.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
SetCompressor /FINAL /SOLID lzma | ||
|
||
!include MUI2.nsh | ||
!include x64.nsh | ||
|
||
Unicode true | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
Name "HashCheck" | ||
OutFile "HashCheckSetup.exe" | ||
|
||
RequestExecutionLevel admin | ||
ManifestSupportedOS all | ||
|
||
!define MUI_ICON ..\HashCheck.ico | ||
!define MUI_ABORTWARNING | ||
|
||
!insertmacro MUI_PAGE_WELCOME | ||
!define MUI_PAGE_CUSTOMFUNCTION_SHOW change_license_font | ||
!insertmacro MUI_PAGE_LICENSE "..\license.txt" | ||
!insertmacro MUI_PAGE_INSTFILES | ||
!insertmacro MUI_PAGE_FINISH | ||
|
||
; Change to a smaller monospace font to more nicely display the license | ||
; | ||
Function change_license_font | ||
FindWindow $0 "#32770" "" $HWNDPARENT | ||
CreateFont $1 "Lucida Console" "7" | ||
GetDlgItem $0 $0 1000 | ||
SendMessage $0 ${WM_SETFONT} $1 1 | ||
FunctionEnd | ||
|
||
; These are the same languages supported by HashCheck | ||
; | ||
!insertmacro MUI_LANGUAGE "English" ; the first language is the default | ||
!insertmacro MUI_LANGUAGE "TradChinese" | ||
!insertmacro MUI_LANGUAGE "SimpChinese" | ||
!insertmacro MUI_LANGUAGE "Czech" | ||
!insertmacro MUI_LANGUAGE "German" | ||
!insertmacro MUI_LANGUAGE "Greek" | ||
!insertmacro MUI_LANGUAGE "SpanishInternational" | ||
!insertmacro MUI_LANGUAGE "French" | ||
!insertmacro MUI_LANGUAGE "Italian" | ||
!insertmacro MUI_LANGUAGE "Japanese" | ||
!insertmacro MUI_LANGUAGE "Korean" | ||
!insertmacro MUI_LANGUAGE "Dutch" | ||
!insertmacro MUI_LANGUAGE "Polish" | ||
!insertmacro MUI_LANGUAGE "PortugueseBR" | ||
!insertmacro MUI_LANGUAGE "Portuguese" | ||
!insertmacro MUI_LANGUAGE "Romanian" | ||
!insertmacro MUI_LANGUAGE "Russian" | ||
!insertmacro MUI_LANGUAGE "Swedish" | ||
!insertmacro MUI_LANGUAGE "Turkish" | ||
!insertmacro MUI_LANGUAGE "Ukrainian" | ||
|
||
; With solid compression, files that are required before the | ||
; actual installation should be stored first in the data block, | ||
; because this will make the installer start faster. | ||
; | ||
!insertmacro MUI_RESERVEFILE_LANGDLL | ||
|
||
; The install script | ||
; | ||
Section | ||
|
||
GetTempFileName $0 | ||
File /oname=$0 ..\bin.x86-32\HashCheck.dll | ||
ExecWait 'regsvr32 /i /n /s "$0"' | ||
IfErrors abort_on_error | ||
Delete $0 | ||
|
||
; One of these exists and is undeletable if and only if | ||
; it was in use and therefore a reboot is now required | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.0 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.1 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.2 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.3 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.4 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.5 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.6 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.7 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.8 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.9 | ||
|
||
${If} ${RunningX64} | ||
${DisableX64FSRedirection} | ||
|
||
File /oname=$0 ..\bin.x86-64\HashCheck.dll | ||
ExecWait 'regsvr32 /i /n /s "$0"' | ||
IfErrors abort_on_error | ||
Delete $0 | ||
|
||
; One of these exists and is undeletable if and only if | ||
; it was in use and therefore a reboot is now required | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.0 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.1 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.2 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.3 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.4 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.5 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.6 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.7 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.8 | ||
Delete /REBOOTOK $SYSDIR\ShellExt\HashCheck.dll.9 | ||
|
||
${EnableX64FSRedirection} | ||
${EndIf} | ||
|
||
Return | ||
|
||
abort_on_error: | ||
MessageBox MB_ICONSTOP|MB_OK "An unexpected error occurred during installation" | ||
|
||
SectionEnd | ||
|
||
Function .onInit | ||
!insertmacro MUI_LANGDLL_DISPLAY | ||
FunctionEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Require NSIS 3xRC for this string to be valid.
If using, NSIS v2x, remove that string before proceeding to compile (line 6)