-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.nsi
66 lines (55 loc) · 1.96 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 "Needle"
!define UNINST_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
!define INST_KEY "SOFTWARE\${PROGRAM_NAME}"
;------------------
; Atributes
Name "Needle"
OutFile "NeedleSetup.exe"
InstallDir "$PROGRAMFILES32\${PROGRAM_NAME}"
RequestExecutionLevel admin
; Unicode True
;------------------
; Icons
!define MUI_UNICON "doll.ico"
!define MUI_ICON "doll.ico"
;------------------
; Installer
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
Section "Needle" Needle
SetOutPath $INSTDIR
File /r "pyinst\Needle\*"
CreateDirectory "$INSTDIR\keys"
WriteRegStr HKLM "${INST_KEY}" "InstallDir" "$INSTDIR"
WriteRegStr HKLM "${INST_KEY}" "DisplayName" "Needle"
WriteRegStr HKLM "${INST_KEY}" "DisplayVersion" "preAlpha"
WriteRegStr HKLM "${INST_KEY}" "DisplayIcon" "$\"$INSTDIR\doll.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" "preAlpha"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayIcon" "$\"$INSTDIR\doll.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\Needle.lnk" "$INSTDIR\Needle.exe"
SectionEnd
;------------------
; Uninstaller
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
Section "Uninstall"
Delete "$DESKTOP\Needle.lnk"
RMDir /r "$INSTDIR"
DeleteRegKey HKLM "${INST_KEY}"
DeleteRegKey HKLM "${UNINST_KEY}"
SectionEnd