forked from mbusb/multibootusb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multibootusb.nsi
85 lines (58 loc) · 2.3 KB
/
multibootusb.nsi
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
;--------------------------------
;NSIS script for creating multibootusb setup file
Name "multibootusb 8.5.0"
OutFile "multibootusb-8.5.0-setup.exe"
SetCompressor lzma
;--------------------------------
;!Include Modern UI
!include "MUI2.nsh"
;--------------------------------
;--------------------------------
; Pages
!insertmacro MUI_PAGE_LICENSE "LICENSE.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
InstallDir "$PROGRAMFILES\multibootusb"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\multibootusb" ""
DirText $(s_InstallHere)
Icon data\tools\multibootusb.ico
Section "Dummy Section" SecDummy
; Install files.
SetOverwrite on
SetOutPath "$INSTDIR"
File /r "dist\multibootusb\*"
SetOutPath "$INSTDIR\data"
File /r "data\*"
; Create shortcut.
SetOutPath -
CreateDirectory "$SMPROGRAMS\multibootusb"
CreateShortCut "$SMPROGRAMS\multibootusb\multibootusb.lnk" "$INSTDIR\multibootusb.exe"
CreateShortCut "$SMPROGRAMS\multibootusb\Uninstall multibootusb.lnk" "$INSTDIR\uninst.exe" "" "$INSTDIR\uninst.exe" 0
; Optionally start program.
MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to run multibootusb now?" IDNO SkipRunProgram
Exec "$INSTDIR\multibootusb.exe"
SkipRunProgram:
; Create uninstaller.
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\multibootusb" "" "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\multibootusb" "DisplayName" "multibootusb (remove only)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\multibootusb" "UninstallString" '"$INSTDIR\uninst.exe"'
WriteUninstaller "$INSTDIR\uninst.exe"
SectionEnd
UninstallText $(s_UnInstall)
Section Uninstall
; Delete shortcuts.
Delete "$SMPROGRAMS\multibootusb\multibootusb.lnk"
Delete "$SMPROGRAMS\multibootusb\Uninstall multibootusb.lnk"
RMDir "$SMPROGRAMS\multibootusb"
Delete "$DESKTOP\multibootusb.lnk"
; Delete registry keys.
Delete "$INSTDIR\uninst.exe"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\multibootusb"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\multibootusb"
; Remove the installation directories.
RMDir /R "$INSTDIR"
SectionEnd