-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.nsi
66 lines (55 loc) · 2.03 KB
/
installer.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
; SeriEx Installer
!include "MUI2.nsh"
;------------------
; defines
!define PROGRAM_NAME "SerialExaminer"
!define UNINST_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
!define INST_KEY "SOFTWARE\${PROGRAM_NAME}"
;------------------
; Atributes
Name "SerialExaminer"
OutFile "SerialExaminerSetup.exe"
InstallDir "$PROGRAMFILES32\${PROGRAM_NAME}"
RequestExecutionLevel admin
; Unicode True
;------------------
; Icons
!define MUI_UNICON "unico.ico"
!define MUI_ICON "ico.ico"
;------------------
; Installer
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
Section "SerialExaminer" SerialExaminer
SetOutPath $INSTDIR
File /r "dist\SerialExaminer\*"
CreateDirectory "$INSTDIR\keys"
WriteRegStr HKLM "${INST_KEY}" "InstallDir" "$INSTDIR"
WriteRegStr HKLM "${INST_KEY}" "DisplayName" "SerialExaminer"
WriteRegStr HKLM "${INST_KEY}" "DisplayVersion" "0.5.0"
WriteRegStr HKLM "${INST_KEY}" "DisplayIcon" "$\"$INSTDIR\ico.ico$\""
WriteRegStr HKLM "${INST_KEY}" "Publisher" "GitHub.com/Pixel48"
WriteRegStr HKLM "${INST_KEY}" "UninstallString" "$INSTDIR\Uninstall.exe"
WriteUninstaller "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM "${UNINST_KEY}" "InstallDir" "$INSTDIR"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "${PROGRAM_NAME}"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "0.5.0"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayIcon" "$\"$INSTDIR\ico.ico$\""
WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "GitHub.com/Pixel48"
WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
WriteRegDWORD HKLM "${UNINST_KEY}" "NoModify" 1
WriteRegDWORD HKLM "${UNINST_KEY}" "NoRepair" 1
SectionEnd
Section "Desktop shortcut"
CreateShortcut "$DESKTOP\SerialExaminer.lnk" "$INSTDIR\SerialExaminer.exe"
SectionEnd
;------------------
; Uninstaller
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
Section "Uninstall"
Delete "$DESKTOP\SerialExaminer.lnk"
RMDir /r "$INSTDIR"
DeleteRegKey HKLM "${INST_KEY}"
DeleteRegKey HKLM "${UNINST_KEY}"
SectionEnd