-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathyaabe.nsi
More file actions
90 lines (70 loc) · 2.66 KB
/
yaabe.nsi
File metadata and controls
90 lines (70 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# NSIS installer script to create an installer wizard for windows
#!define nsis_stage_dir = nsis_stage #should be defined via command line
!include MUI2.nsh
Unicode True
!define name "YAABE BIOS Editor"
Name "${name}"
VIAddVersionKey /LANG=0 "ProductName" "${name}"
VIAddVersionKey /LANG=0 "FileVersion" "${yaabe_version}"
VIAddVersionKey /LANG=0 "ProductVersion" "${yaabe_version}"
VIAddVersionKey /LANG=0 "FileDescription" "https://github.com/netblock/yaabe"
VIAddVersionKey /LANG=0 "LegalCopyright" "Copyright Netblock"
VIProductVersion "${yaabe_version}.0"
Outfile "${yaabe_outfile}"
SetCompressor /solid lzma
RequestExecutionLevel admin
#RequestExecutionLevel user # TODO only request admin if install dir needs it
InstallDir "$PROGRAMFILES64\yaabe"
# if previously installed, get previous install location:
InstallDirRegKey HKEY_LOCAL_MACHINE "Software\YAABE" InstallLocation
ShowInstDetails show
!define MUI_ABORTWARNING
#!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${nsis_stage_dir}\LICENSE"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
#!insertmacro MUI_PAGE_STARTMENU Application $SMPROGRAMS
!define MUI_FINISHPAGE_LINK "YAABE Github page"
!define MUI_FINISHPAGE_LINK_LOCATION "https://github.com/netblock/yaabe"
!define MUI_FINISHPAGE_SHOWREADME ""
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Start Menu shortcut"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION CreateStartShortcut
#!define MUI_FINISHPAGE_RUN
#!define MUI_FINISHPAGE_RUN_TEXT "Run $(^Name)"
#!define MUI_FINISHPAGE_RUN_FUNCTION RunShortcut
# TODO for some reason libgio-2.0-0.dll (2.78.0.0) crashes if YAABE is
# launched via the installer.
!insertmacro MUI_PAGE_FINISH
#!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Section "YAABE"
SetShellVarContext all
SetOutPath "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "Software\YAABE" InstallLocation "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "Software\YAABE" Version "${yaabe_version}"
WriteUninstaller uninstall.exe
File /r "${nsis_stage_dir}\*"
SectionEnd
Section "Uninstall"
Delete "$instDIR\*.dll"
Delete "$INSTDIR\yaabe.exe"
Delete "$INSTDIR\LICENSE"
Delete "$INSTDIR\THIRD_PARTY_LICENSE"
Delete "$INSTDIR\uninstall.exe"
RMDir /r "$INSTDIR\etc"
RMDir /r "$INSTDIR\share"
RMDir "$INSTDIR"
Delete "$SMPROGRAMS\$(^Name).lnk"
DeleteRegKey HKEY_LOCAL_MACHINE "Software\YAABE"
SectionEnd
Function CreateStartShortcut
SetShellVarContext all
CreateShortcut "$SMPrograms\$(^Name).lnk" "$INSTDIR\yaabe.exe"
FunctionEnd
Function RunShortcut
SetShellVarContext all
ExecShell "open" "$SMPrograms\$(^Name).lnk"
FunctionEnd