This repository was archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathSPCode_Stable.nsi
More file actions
144 lines (107 loc) · 4.28 KB
/
SPCode_Stable.nsi
File metadata and controls
144 lines (107 loc) · 4.28 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
!include "MUI2.nsh"
!include "DotNetChecker.nsh"
!include "FileAssociation.nsh"
!addplugindir .\nsis-plugins
Name "SPCode"
OutFile "SPCode.Installer.exe"
InstallDir $APPDATA\spcode
RequestExecutionLevel admin
!define SHCNE_ASSOCCHANGED 0x8000000
!define SHCNF_IDLIST 0
!define MUI_ABORTWARNING
!define MUI_ICON "icon.ico"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "GPLv3.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section "Program" prog01
SectionIn 1 RO
SetOutPath $INSTDIR
!insertmacro CheckNetFramework 48
File SPCode.exe
File License.txt
File GPLv3.txt
CreateDirectory "$APPDATA\spcode\crashlogs"
CreateDirectory "$APPDATA\spcode\lysis"
CreateDirectory "$APPDATA\spcode\sourcepawn"
CreateDirectory "$APPDATA\spcode\sourcepawn\errorfiles"
CreateDirectory "$APPDATA\spcode\sourcepawn\temp"
CreateDirectory "$APPDATA\spcode\sourcepawn\templates"
CreateDirectory "$APPDATA\spcode\sourcepawn\configs"
CreateDirectory "$APPDATA\spcode\sourcepawn\configs\sm_1_10_0_6509"
SetOutPath $APPDATA\spcode
File /r ".\sourcepawn"
File /r ".\lysis"
IfFileExists $APPDATA\spcode\options_0.dat OptionsExist OptionsDoesNotExist
OptionsExist:
Delete $APPDATA\spcode\options_0.dat
OptionsDoesNotExist:
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\spcode" "DisplayName" "SPCode - A lightweight SourcePawn editor"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\spcode" "UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\spcode" "InstallLocation" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\spcode" "DisplayIcon" "$INSTDIR\SPCode.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\spcode" "Publisher" "SPCode Organization"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\spcode" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\spcode" "NoRepair" 1
WriteUninstaller $INSTDIR\uninstall.exe
SectionEnd
Section "File Association (.sp)" prog02
SectionIn 1
${registerExtension} "$INSTDIR\SPCode.exe" ".sp" "SourcePawn Script"
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
SectionEnd
Section "File Association (.inc)" prog03
SectionIn 1
${registerExtension} "$INSTDIR\SPCode.exe" ".inc" "SourcePawn Include"
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
SectionEnd
Section "File Association (.smx)" prog04
SectionIn 1
${registerExtension} "$INSTDIR\SPCode.exe" ".smx" "SourceMod Plugin"
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
SectionEnd
Section "Desktop Shortcut" prog05
SectionIn 1
CreateShortCut "$DESKTOP\SPCode.lnk" "$INSTDIR\SPCode.exe" ""
SectionEnd
Section "Startmenu Shortcut" prog06
SectionIn 1
CreateShortCut "$SMPROGRAMS\SPCode.lnk" "$INSTDIR\SPCode.exe" ""
SectionEnd
Section "Uninstall"
Delete $INSTDIR\uninstall.exe
Delete $INSTDIR\SPCode.exe
Delete $INSTDIR\MahApps.Metro.dll
Delete $INSTDIR\ICSharpCode.AvalonEdit.dll
Delete $INSTDIR\System.Windows.Interactivity.dll
Delete $INSTDIR\Xceed.Wpf.AvalonDock.dll
Delete $INSTDIR\Xceed.Wpf.AvalonDock.Themes.Metro.dll
Delete $INSTDIR\smxdasm.dll
Delete $INSTDIR\LysisForSpedit.dll
Delete $INSTDIR\ValveQuery.dll
Delete $INSTDIR\SourcepawnCondenser.dll
Delete $INSTDIR\Renci.SshNet.dll
Delete $INSTDIR\Newtonsoft.Json.dll
Delete $INSTDIR\MdXaml.dll
Delete $INSTDIR\DiscordRPC.dll
Delete $INSTDIR\Microsoft.WindowsAPICodePack.dll
Delete $INSTDIR\Microsoft.WindowsAPICodePack.Shell.dll
Delete $INSTDIR\lang_0_spcode.xml
Delete $INSTDIR\License.txt
Delete $INSTDIR\GPLv3.txt
Delete $INSTDIR\*.dat
RMDir /r $APPDATA\spcode
RMDir $INSTDIR
Delete "$DESKTOP\SPCode.lnk"
Delete "$SMPROGRAMS\SPCode.lnk"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\spcode"
${unregisterExtension} ".sp" "Sourcepawn Script"
${unregisterExtension} ".inc" "Sourcepawn Include-File"
${unregisterExtension} ".smx" "Sourcemod Plugin"
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
SectionEnd