-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathonyx.nsi
144 lines (124 loc) · 3.66 KB
/
onyx.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
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
RequestExecutionLevel user
SetCompressor zlib
Name "OverbiteNX Onyx Component"
OutFile "onyxinst.exe"
InstallDir "$LOCALAPPDATA\OverbiteNX"
VIProductVersion "0.9.2.0"
VIAddVersionKey "FileVersion" "0.9.2.0"
VIAddVersionKey "ProductName" "OverbiteNX Onyx Component Installer"
VIAddVersionKey "CompanyName" "The Overbite Project"
VIAddVersionKey "LegalCopyright" "© 2018 Cameron Kaiser"
VIAddVersionKey "FileDescription" "The native component for the OverbiteNX Gopher client."
function StrReplace
Exch $0
Exch
Exch $1
Exch
Exch 2
Exch $2
Push $3
Push $4
Push $5
Push $6
Push $7
Push $R0
Push $R1
Push $R2
StrCpy $3 "-1"
StrCpy $5 ""
StrLen $6 $1
StrLen $7 $0
Loop:
IntOp $3 $3 + 1
Loop_noinc:
StrCpy $4 $2 $6 $3
StrCmp $4 "" ExitLoop
StrCmp $4 $1 Replace
Goto Loop
Replace:
StrCpy $R0 $2 $3
IntOp $R2 $3 + $6
StrCpy $R1 $2 "" $R2
StrCpy $2 $R0$0$R1
IntOp $3 $3 + $7
Goto Loop_noinc
ExitLoop:
StrCpy $0 $2
Pop $R2
Pop $R1
Pop $R0
Pop $7
Pop $6
Pop $5
Pop $4
Pop $3
Pop $2
Pop $1
Exch $0
FunctionEnd
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
Section
SetOutPath $INSTDIR
File "onyx.exe"
FileOpen $0 "$INSTDIR\onyx.json" w
FileWrite $0 "{"
FileWriteByte $0 "13"
FileWriteByte $0 "10"
FileWrite $0 ' "name" : "onyx",'
FileWriteByte $0 "13"
FileWriteByte $0 "10"
FileWrite $0 ' "description": "OverbiteNX Gopher system component",'
FileWriteByte $0 "13"
FileWriteByte $0 "10"
FileWrite $0 ' "path": "'
; Double-backslash the path for JSON purposes.
Push "$INSTDIR\onyx.exe"
Push "\"
Push "BACKSLASH_SEQUENCE"
Call StrReplace
Push "BACKSLASH_SEQUENCE"
Push "\\"
Call StrReplace
Pop $1
FileWrite $0 $1
FileWrite $0 '",'
FileWriteByte $0 "13"
FileWriteByte $0 "10"
FileWrite $0 ' "type": "stdio",'
FileWriteByte $0 "13"
FileWriteByte $0 "10"
FileWrite $0 ' "allowed_extensions": [ "[email protected]" ]'
FileWriteByte $0 "13"
FileWriteByte $0 "10"
FileWrite $0 "}"
FileWriteByte $0 "13"
FileWriteByte $0 "10"
FileClose $0
WriteUninstaller "$INSTDIR\Uninstall Onyx.exe"
SetRegView 64
WriteRegStr HKCU "SOFTWARE\Mozilla\NativeMessagingHosts\onyx" "" "$INSTDIR\onyx.json"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OverbiteNX" "DisplayName" "OverbiteNX Onyx Component"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OverbiteNX" "Comments" "This is the native component that enables Firefox to connect to Gopher servers using OverbiteNX."
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OverbiteNX" "Publisher" "The Overbite Project"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OverbiteNX" "HelpLink" "https://gopher.floodgap.com/overbite/"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OverbiteNX" "UninstallString" "$\"$INSTDIR\Uninstall Onyx.exe$\""
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OverbiteNX" "EstimatedSize" "130"
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OverbiteNX" "NoModify" "1"
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OverbiteNX" "NoRepair" "1"
SectionEnd
Section "Uninstall"
MessageBox MB_OKCANCEL "Make sure Firefox is closed before continuing with uninstallation." IDOK next IDCANCEL quit
quit:
Abort "Restart the Uninstaller after quitting Firefox."
next:
SetRegView 64
DeleteRegKey HKCU "SOFTWARE\Mozilla\NativeMessagingHosts\onyx"
DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OverbiteNX"
Delete "$INSTDIR\Uninstall Onyx.exe"
Delete "$INSTDIR\onyx.json"
Delete "$INSTDIR\onyx.exe"
RMDir "$INSTDIR"
SectionEnd