Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit 1d32e91

Browse files
committed
Fixed some bugs and updated installation scripts
1 parent c50f87f commit 1d32e91

File tree

7 files changed

+436
-390
lines changed

7 files changed

+436
-390
lines changed

build/windows/uget-chrome-wrapper.nsi

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
!endif
3232
Pop ${output}
3333
!macroend
34-
34+
3535
!macro Func_StrRep un
3636
Function ${un}StrRep
3737
Exch $R2 ;new
@@ -46,7 +46,7 @@
4646
Push $R7
4747
Push $R8
4848
Push $R9
49-
49+
5050
StrCpy $R3 0
5151
StrLen $R4 $R1
5252
StrLen $R6 $R0
@@ -66,7 +66,7 @@
6666
IntOp $R3 $R3 + $R9 ;move offset by length of the replacement string
6767
Goto loop
6868
done:
69-
69+
7070
Pop $R9
7171
Pop $R8
7272
Pop $R7
@@ -101,7 +101,7 @@
101101

102102
;Default installation folder
103103
InstallDir $PROGRAMFILES\uget-chrome-wrapper
104-
104+
105105
;Get installation folder from registry if available
106106
InstallDirRegKey HKLM "Software\uget-chrome-wrapper" "Install_Dir"
107107

@@ -119,13 +119,13 @@
119119
!insertmacro MUI_PAGE_LICENSE "../../LICENSE"
120120
!insertmacro MUI_PAGE_DIRECTORY
121121
!insertmacro MUI_PAGE_INSTFILES
122-
122+
123123
!insertmacro MUI_UNPAGE_CONFIRM
124124
!insertmacro MUI_UNPAGE_INSTFILES
125-
125+
126126
;--------------------------------
127127
;Languages
128-
128+
129129
!insertmacro MUI_LANGUAGE "English"
130130

131131

@@ -146,16 +146,23 @@ Section "uget-chrome-wrapper (required)"
146146
; Replace \ by \\ in the installation path
147147
${StrRep} $0 "$INSTDIR" "\" "\\"
148148

149-
; Update the json file
149+
; Update the com.javahelps.ugetchromewrapper.json file
150150
FileOpen $9 $INSTDIR\com.javahelps.ugetchromewrapper.json w ;Opens a Empty File an fills it
151151
FileWrite $9 '{"name":"com.javahelps.ugetchromewrapper","description":"Integrate uGet with Google Chrome","path":"$0\\uget-chrome-wrapper.py","type":"stdio","allowed_origins":["chrome-extension://efjgjleilhflffpbnkaofpmdnajdpepi/","chrome-extension://akcbnhoidebjpiefdkmaaicfgdpbnoac/"]}$\r$\n'
152152
FileClose $9 ;Closes the filled file
153153

154+
; Update the com.javahelps.ugetfirefoxwrapper.json file
155+
FileOpen $9 $INSTDIR\com.javahelps.ugetfirefoxwrapper.json w ;Opens a Empty File an fills it
156+
FileWrite $9 '{"name":"com.javahelps.ugetfirefoxwrapper","description":"Integrate uGet with Mozilla Firefox","path":"$0\\uget-chrome-wrapper.py","type":"stdio","allowed_extensions":["uget-integration@slgobinath"]}$\r$\n'
157+
FileClose $9 ;Closes the filled file
154158

155159
; Write the installation path into the registry
156160
WriteRegStr HKLM SOFTWARE\uget-chrome-wrapper "Install_Dir" "$INSTDIR"
157161
WriteRegStr HKCU "SOFTWARE\Google\Chrome\NativeMessagingHosts\com.javahelps.ugetchromewrapper" "" "$INSTDIR\com.javahelps.ugetchromewrapper.json"
158162
WriteRegStr HKLM "SOFTWARE\Google\Chrome\NativeMessagingHosts\com.javahelps.ugetchromewrapper" "" "$INSTDIR\com.javahelps.ugetchromewrapper.json"
163+
WriteRegStr HKCU "SOFTWARE\Mozilla\NativeMessagingHosts\com.javahelps.ugetfirefoxwrapper" "" "$INSTDIR\com.javahelps.ugetfirefoxwrapper.json"
164+
WriteRegStr HKLM "SOFTWARE\Mozilla\NativeMessagingHosts\com.javahelps.ugetfirefoxwrapper" "" "$INSTDIR\com.javahelps.ugetfirefoxwrapper.json"
165+
159166

160167
; Write the uninstall keys for Windows
161168
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\uget-chrome-wrapper" "DisplayName" "uGet Chrome Wrapper"
@@ -171,10 +178,12 @@ SectionEnd
171178
; Uninstaller
172179

173180
Section "Uninstall"
174-
181+
175182
; Remove registry keys
176183
DeleteRegKey HKCU "SOFTWARE\Google\Chrome\NativeMessagingHosts\com.javahelps.ugetchromewrapper"
177184
DeleteRegKey HKLM "SOFTWARE\Google\Chrome\NativeMessagingHosts\com.javahelps.ugetchromewrapper"
185+
DeleteRegKey HKCU "SOFTWARE\Mozilla\NativeMessagingHosts\com.javahelps.ugetfirefoxwrapper"
186+
DeleteRegKey HKLM "SOFTWARE\Mozilla\NativeMessagingHosts\com.javahelps.ugetfirefoxwrapper"
178187
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\uget-chrome-wrapper"
179188
DeleteRegKey HKLM SOFTWARE\uget-chrome-wrapper
180189

0 commit comments

Comments
 (0)