This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstallerscript.nsis
97 lines (73 loc) · 3.45 KB
/
installerscript.nsis
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
91
92
93
94
95
96
97
!include "MUI2.nsh"
Name "APB Config Manager v2.0.0"
Unicode True
!insertmacro MUI_PAGE_LICENSE "LICENSE"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
!define MUI_PAGE_HEADER_TEXT "APB Config Manager v2.0.0"
!define MUI_PAGE_HEADER_SUBTEXT "Installation Wizard"
!define MUI_ABORTWARNING
OutFile "NSIS Output\apb-config-manager-setup.exe"
InstallDir "$PROGRAMFILES64\APB Config Manager"
RequestExecutionLevel admin
Section
SetOutPath $INSTDIR
File "APBConfigManager.UI\bin\Release\net6.0\publish\win-x64\*.dll"
File "APBConfigManager.UI\bin\Release\net6.0\publish\win-x64\*.exe"
WriteUninstaller "$INSTDIR\uninstall.exe"
# Start-menu shortcut
# CreateShortcut "$SMPROGRAMS\APB Config Manager.lnk" "$INSTDIR\APBConfigManager.UI.exe"
# Desktop shortcut
# CreateShortcut "$DESKTOP\APB Config Manager.lnk" "$INSTDIR\APBConfigManager.UI.exe"
# Uninstaller start-menu shortcut
# CreateShortcut "$SMPROGRAMS\Uninstall APB Config Manager.lnk" "$INSTDIR\uninstall.exe"
# Add uninstall information to Add/Remove Programs
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\APBConfigManager" \
"DisplayName" "APB Config Manager"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\APBConfigManager" \
"UninstallString" "$\"$INSTDIR\uninstall.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\APBConfigManager" \
"InstallLocation" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\APBConfigManager" \
"Publisher" "xela"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\APBConfigManager" \
"NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\APBConfigManager" \
"NoRepair" 1'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\APBConfigManager" \
"URLInfoAbout" "https://github.com/imxela/apb-config-manager"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\APBConfigManager" \
"DisplayVersion" "v2.0.0"
SectionEnd
Section /o "Desktop Shortcut"
# Application desktop shortcut
CreateShortcut "$DESKTOP\APB Config Manager.lnk" "$INSTDIR\APBConfigManager.UI.exe"
SectionEnd
Section "Start-Menu Shortcut"
# Application start-menu shortcut
CreateShortcut "$SMPROGRAMS\APB Config Manager.lnk" "$INSTDIR\APBConfigManager.UI.exe"
# Uninstaller start-menu shortcut
CreateShortcut "$SMPROGRAMS\Uninstall APB Config Manager.lnk" "$INSTDIR\uninstall.exe"
SectionEnd
Section "-Uninstall"
ExecWait '"$INSTDIR\APBConfigManager.UI.exe" --unlink'
Delete "$SMPROGRAMS\APB Config Manager.lnk"
Delete "$SMPROGRAMS\Uninstall APB Config Manager.lnk"
Delete "$DESKTOP\APB Config Manager.lnk"
Delete "$INSTDIR\uninstall.exe"
Delete "$INSTDIR\APBConfigManager.UI.exe"
Delete "$INSTDIR\libHarfBuzzSharp.dll"
Delete "$INSTDIR\libSkiaSharp.dll"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\APBConfigManager"
RMDir $INSTDIR
SectionEnd
Section /o "un.Delete User Data"
RMDir /r "$APPDATA\APBConfigManager\"
SectionEnd