-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathwin-64-install.nsi
64 lines (53 loc) · 2.31 KB
/
win-64-install.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
; Main constants - define following constants as you want them displayed in your installation wizard
!define PRODUCT_NAME "Asv.Avalonia.Gui"
!define PRODUCT_PUBLISHER "Cursir"
; Following constants you should never change
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!include "MUI.nsh"
!define MUI_ABORTWARNING
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
; Wizard pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Name "Asv Drones Gui "
OutFile "AsvDronesGuiInstaller.exe"
InstallDir "$PROGRAMFILES\Asv\Asv-Drones-Gui"
ShowInstDetails show
ShowUnInstDetails show
; Following lists the files you want to include, go through this list carefully!
Section "MainSection" SEC01
SetOutPath "$INSTDIR"
; Check dir in yml where your project is stored
File /r "./publish/app\\*.*"
SectionEnd
Section -Post
;Following lines will make uninstaller work - do not change anything, unless you really want to.
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
SectionEnd
; Replace the following strings to suite your needs
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "Application was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove Asv Drones Gui and all of its components?" IDYES +2
Abort
FunctionEnd
; Remove any file that you have added above - removing uninstallation and folders last.
; Note: if there is any file changed or added to these folders, they will not be removed. Also, parent folder (which in my example
; is company name ZWare) will not be removed if there is any other application installed in it.
Section Uninstall
; Remove the installed files
Delete "$INSTDIR\*.*"
; Remove the installation directory
RMDir /r "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SetAutoClose true
SectionEnd