This repository was archived by the owner on Nov 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathsetup.nsi
executable file
·82 lines (59 loc) · 2.37 KB
/
setup.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
; Script generated with the Venis Install Wizard
; Define your application name
!define APPNAME "SuperPutty"
!define APPNAMEANDVERSION "SuperPutty"
; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES\SuperPutty"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "superputty-setup_v1.0.3.exe"
LicenseData "License.txt"
LicenseText "If you accept the terms of the agreement, click I Agree to continue. You must accept the agreement to install ${APPNAMEANDVERSION}."
DirText "Choose the folder in which to install ${APPNAMEANDVERSION}."
Section "SuperPutty"
; Set Section properties
SetOverwrite on
; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\"
File "bin\Release\SuperPutty.exe"
File "bin\Release\System.Data.SQLite.DLL"
File "bin\Release\WeifenLuo.WinFormsUI.Docking.dll"
CreateShortCut "$DESKTOP\SuperPutty.lnk" "$INSTDIR\SuperPutty.exe"
CreateDirectory "$SMPROGRAMS\SuperPutty"
CreateShortCut "$SMPROGRAMS\SuperPutty\SuperPutty.lnk" "$INSTDIR\SuperPutty.exe"
CreateShortCut "$SMPROGRAMS\SuperPutty\Uninstall.lnk" "$INSTDIR\uninstall.exe"
SectionEnd
Section -FinishSection
WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteUninstaller "$INSTDIR\uninstall.exe"
MessageBox MB_YESNO "Would you like to run ${APPNAMEANDVERSION}?" IDNO NoRun
Exec "$INSTDIR\SuperPutty.exe"
NoRun:
SectionEnd
;Uninstall section
Section Uninstall
;Remove from registry...
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
; Delete self
Delete "$INSTDIR\uninstall.exe"
; Delete Shortcuts
Delete "$DESKTOP\SuperPutty.lnk"
Delete "$SMPROGRAMS\SuperPutty\SuperPutty.lnk"
Delete "$SMPROGRAMS\SuperPutty\Uninstall.lnk"
; Clean up SuperPutty
Delete "$INSTDIR\SuperPutty.exe"
Delete "$INSTDIR\System.Data.SQLite.DLL"
Delete "$INSTDIR\WeifenLuo.WinFormsUI.Docking.dll"
; Remove remaining directories
RMDir "$SMPROGRAMS\SuperPutty"
RMDir "$INSTDIR\"
SectionEnd
Function un.onInit
MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONQUESTION "Remove ${APPNAMEANDVERSION} and all of its components?" IDYES DoUninstall
Abort
DoUninstall:
FunctionEnd
; eof