app-builder-lib 22.14.11 → 23.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/asar/asar.d.ts +1 -0
- package/out/asar/asar.js +11 -4
- package/out/asar/asar.js.map +1 -1
- package/out/asar/asarUtil.js +4 -2
- package/out/asar/asarUtil.js.map +1 -1
- package/out/asar/integrity.d.ts +13 -11
- package/out/asar/integrity.js +68 -12
- package/out/asar/integrity.js.map +1 -1
- package/out/codeSign/macCodeSign.js +1 -1
- package/out/codeSign/macCodeSign.js.map +1 -1
- package/out/electron/electronMac.js +1 -1
- package/out/electron/electronMac.js.map +1 -1
- package/out/options/FileAssociation.d.ts +3 -3
- package/out/options/FileAssociation.js.map +1 -1
- package/out/options/MsiOptions.d.ts +0 -4
- package/out/options/MsiOptions.js.map +1 -1
- package/out/options/PlatformSpecificBuildOptions.d.ts +1 -2
- package/out/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/out/options/SnapOptions.d.ts +5 -0
- package/out/options/SnapOptions.js.map +1 -1
- package/out/options/linuxOptions.d.ts +1 -1
- package/out/options/linuxOptions.js.map +1 -1
- package/out/platformPackager.js +2 -1
- package/out/platformPackager.js.map +1 -1
- package/out/publish/PublishManager.js +7 -12
- package/out/publish/PublishManager.js.map +1 -1
- package/out/publish/s3/s3Publisher.d.ts +1 -1
- package/out/publish/s3/s3Publisher.js +1 -1
- package/out/publish/s3/s3Publisher.js.map +1 -1
- package/out/publish/s3/spacesPublisher.d.ts +1 -1
- package/out/publish/s3/spacesPublisher.js +1 -1
- package/out/publish/s3/spacesPublisher.js.map +1 -1
- package/out/publish/updateInfoBuilder.js +2 -4
- package/out/publish/updateInfoBuilder.js.map +1 -1
- package/out/targets/AppImageTarget.js.map +1 -1
- package/out/targets/LinuxTargetHelper.js +2 -2
- package/out/targets/LinuxTargetHelper.js.map +1 -1
- package/out/targets/MsiTarget.d.ts +6 -0
- package/out/targets/MsiTarget.js +32 -21
- package/out/targets/MsiTarget.js.map +1 -1
- package/out/targets/nsis/NsisTarget.js +1 -0
- package/out/targets/nsis/NsisTarget.js.map +1 -1
- package/out/targets/snap.js +4 -0
- package/out/targets/snap.js.map +1 -1
- package/out/util/yarn.js +6 -5
- package/out/util/yarn.js.map +1 -1
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/package.json +108 -108
- package/scheme.json +20 -214
- package/templates/msi/template.xml +42 -15
- package/templates/nsis/include/extractAppPackage.nsh +36 -0
- package/templates/nsis/include/installUtil.nsh +36 -8
- package/templates/nsis/messages.yml +2 -0
- package/templates/nsis/uninstaller.nsh +131 -7
- package/templates/snap/snapcraft.yaml +1 -0
- package/CHANGELOG.md +0 -186
- package/LICENSE +0 -22
- package/out/publish/BintrayPublisher.d.ts +0 -17
- package/out/publish/BintrayPublisher.js +0 -89
- package/out/publish/BintrayPublisher.js.map +0 -1
- package/templates/msi/WixUI_Assisted.wxs +0 -134
|
@@ -126,7 +126,10 @@ Function handleUninstallResult
|
|
|
126
126
|
Return
|
|
127
127
|
|
|
128
128
|
${if} $R0 != 0
|
|
129
|
+
MessageBox MB_OK|MB_ICONEXCLAMATION "$(uninstallFailed): $R0"
|
|
129
130
|
DetailPrint `Uninstall was not successful. Uninstaller error code: $R0.`
|
|
131
|
+
SetErrorLevel 2
|
|
132
|
+
Quit
|
|
130
133
|
${endif}
|
|
131
134
|
FunctionEnd
|
|
132
135
|
|
|
@@ -156,7 +159,7 @@ Function uninstallOldVersion
|
|
|
156
159
|
!endif
|
|
157
160
|
${if} $uninstallString == ""
|
|
158
161
|
ClearErrors
|
|
159
|
-
|
|
162
|
+
Return
|
|
160
163
|
${endif}
|
|
161
164
|
${endif}
|
|
162
165
|
|
|
@@ -175,7 +178,7 @@ Function uninstallOldVersion
|
|
|
175
178
|
${if} $installationDir == ""
|
|
176
179
|
${andIf} $uninstallerFileName == ""
|
|
177
180
|
ClearErrors
|
|
178
|
-
|
|
181
|
+
Return
|
|
179
182
|
${endif}
|
|
180
183
|
|
|
181
184
|
${if} $installMode == "CurrentUser"
|
|
@@ -206,12 +209,37 @@ Function uninstallOldVersion
|
|
|
206
209
|
StrCpy $uninstallerFileNameTemp "$PLUGINSDIR\old-uninstaller.exe"
|
|
207
210
|
!insertmacro copyFile "$uninstallerFileName" "$uninstallerFileNameTemp"
|
|
208
211
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
212
|
+
# Retry counter
|
|
213
|
+
StrCpy $R5 0
|
|
214
|
+
|
|
215
|
+
UninstallLoop:
|
|
216
|
+
IntOp $R5 $R5 + 1
|
|
217
|
+
|
|
218
|
+
${if} $R5 > 5
|
|
219
|
+
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "$(appCannotBeClosed)" /SD IDCANCEL IDRETRY OneMoreAttempt
|
|
220
|
+
Return
|
|
221
|
+
${endIf}
|
|
222
|
+
|
|
223
|
+
OneMoreAttempt:
|
|
224
|
+
ExecWait '"$uninstallerFileNameTemp" /S /KEEP_APP_DATA $0 _?=$installationDir' $R0
|
|
225
|
+
ifErrors TryInPlace CheckResult
|
|
226
|
+
|
|
227
|
+
TryInPlace:
|
|
228
|
+
# the execution failed - might have been caused by some group policy restrictions
|
|
229
|
+
# we try to execute the uninstaller in place
|
|
230
|
+
ExecWait '"$uninstallerFileName" /S /KEEP_APP_DATA $0 _?=$installationDir' $R0
|
|
231
|
+
ifErrors DoesNotExist
|
|
232
|
+
|
|
233
|
+
CheckResult:
|
|
234
|
+
${if} $R0 == 0
|
|
235
|
+
Return
|
|
236
|
+
${endIf}
|
|
237
|
+
|
|
238
|
+
Sleep 1000
|
|
239
|
+
Goto UninstallLoop
|
|
240
|
+
|
|
241
|
+
DoesNotExist:
|
|
242
|
+
SetErrors
|
|
215
243
|
FunctionEnd
|
|
216
244
|
|
|
217
245
|
!macro uninstallOldVersion ROOT_KEY
|
|
@@ -144,3 +144,5 @@ areYouSureToUninstall:
|
|
|
144
144
|
da: Er du sikker på, at du vil afinstallere ${PRODUCT_NAME}?
|
|
145
145
|
decompressionFailed:
|
|
146
146
|
en: Failed to decompress files. Please try running the installer again.
|
|
147
|
+
uninstallFailed:
|
|
148
|
+
en: Failed to uninstall old application files. Please try running the installer again.
|
|
@@ -28,6 +28,109 @@ Function un.onInit
|
|
|
28
28
|
!endif
|
|
29
29
|
FunctionEnd
|
|
30
30
|
|
|
31
|
+
Function un.atomicRMDir
|
|
32
|
+
Exch $R0
|
|
33
|
+
Push $R1
|
|
34
|
+
Push $R2
|
|
35
|
+
Push $R3
|
|
36
|
+
|
|
37
|
+
StrCpy $R3 "$INSTDIR$R0\*.*"
|
|
38
|
+
FindFirst $R1 $R2 $R3
|
|
39
|
+
|
|
40
|
+
loop:
|
|
41
|
+
StrCmp $R2 "" break
|
|
42
|
+
|
|
43
|
+
StrCmp $R2 "." continue
|
|
44
|
+
StrCmp $R2 ".." continue
|
|
45
|
+
|
|
46
|
+
IfFileExists "$INSTDIR$R0\$R2\*.*" isDir isNotDir
|
|
47
|
+
|
|
48
|
+
isDir:
|
|
49
|
+
CreateDirectory "$PLUGINSDIR\old-install$R0\$R2"
|
|
50
|
+
|
|
51
|
+
Push "$R0\$R2"
|
|
52
|
+
Call un.atomicRMDir
|
|
53
|
+
Pop $R3
|
|
54
|
+
|
|
55
|
+
${if} $R3 != 0
|
|
56
|
+
Goto done
|
|
57
|
+
${endIf}
|
|
58
|
+
|
|
59
|
+
Goto continue
|
|
60
|
+
|
|
61
|
+
isNotDir:
|
|
62
|
+
ClearErrors
|
|
63
|
+
Rename "$INSTDIR$R0\$R2" "$PLUGINSDIR\old-install$R0\$R2"
|
|
64
|
+
|
|
65
|
+
# Ignore errors when renaming ourselves.
|
|
66
|
+
StrCmp "$R0\$R2" "${UNINSTALL_FILENAME}" 0 +2
|
|
67
|
+
ClearErrors
|
|
68
|
+
|
|
69
|
+
IfErrors 0 +3
|
|
70
|
+
StrCpy $R3 "$INSTDIR$R0\$R2"
|
|
71
|
+
Goto done
|
|
72
|
+
|
|
73
|
+
continue:
|
|
74
|
+
FindNext $R1 $R2
|
|
75
|
+
Goto loop
|
|
76
|
+
|
|
77
|
+
break:
|
|
78
|
+
StrCpy $R3 0
|
|
79
|
+
|
|
80
|
+
done:
|
|
81
|
+
FindClose $R1
|
|
82
|
+
|
|
83
|
+
StrCpy $R0 $R3
|
|
84
|
+
|
|
85
|
+
Pop $R3
|
|
86
|
+
Pop $R2
|
|
87
|
+
Pop $R1
|
|
88
|
+
Exch $R0
|
|
89
|
+
FunctionEnd
|
|
90
|
+
|
|
91
|
+
Function un.restoreFiles
|
|
92
|
+
Exch $R0
|
|
93
|
+
Push $R1
|
|
94
|
+
Push $R2
|
|
95
|
+
Push $R3
|
|
96
|
+
|
|
97
|
+
StrCpy $R3 "$PLUGINSDIR\old-install$R0\*.*"
|
|
98
|
+
FindFirst $R1 $R2 $R3
|
|
99
|
+
|
|
100
|
+
loop:
|
|
101
|
+
StrCmp $R2 "" break
|
|
102
|
+
|
|
103
|
+
StrCmp $R2 "." continue
|
|
104
|
+
StrCmp $R2 ".." continue
|
|
105
|
+
|
|
106
|
+
IfFileExists "$INSTDIR$R0\$R2\*.*" isDir isNotDir
|
|
107
|
+
|
|
108
|
+
isDir:
|
|
109
|
+
CreateDirectory "$INSTDIR$R0\$R2"
|
|
110
|
+
|
|
111
|
+
Push "$R0\$R2"
|
|
112
|
+
Call un.restoreFiles
|
|
113
|
+
Pop $R3
|
|
114
|
+
|
|
115
|
+
Goto continue
|
|
116
|
+
|
|
117
|
+
isNotDir:
|
|
118
|
+
Rename $PLUGINSDIR\old-install$R0\$R2" "$INSTDIR$R0\$R2"
|
|
119
|
+
|
|
120
|
+
continue:
|
|
121
|
+
FindNext $R1 $R2
|
|
122
|
+
Goto loop
|
|
123
|
+
|
|
124
|
+
break:
|
|
125
|
+
StrCpy $R0 0
|
|
126
|
+
FindClose $R1
|
|
127
|
+
|
|
128
|
+
Pop $R3
|
|
129
|
+
Pop $R2
|
|
130
|
+
Pop $R1
|
|
131
|
+
Exch $R0
|
|
132
|
+
FunctionEnd
|
|
133
|
+
|
|
31
134
|
Section "un.install"
|
|
32
135
|
# for assisted installer we check it here to show progress
|
|
33
136
|
!ifndef ONE_CLICK
|
|
@@ -38,6 +141,34 @@ Section "un.install"
|
|
|
38
141
|
|
|
39
142
|
!insertmacro setLinkVars
|
|
40
143
|
|
|
144
|
+
# delete the installed files
|
|
145
|
+
!ifmacrodef customRemoveFiles
|
|
146
|
+
!insertmacro customRemoveFiles
|
|
147
|
+
!else
|
|
148
|
+
${if} ${isUpdated}
|
|
149
|
+
CreateDirectory "$PLUGINSDIR\old-install"
|
|
150
|
+
|
|
151
|
+
Push ""
|
|
152
|
+
Call un.atomicRMDir
|
|
153
|
+
Pop $R0
|
|
154
|
+
|
|
155
|
+
${if} $R0 != 0
|
|
156
|
+
DetailPrint "File is busy, aborting: $R0"
|
|
157
|
+
|
|
158
|
+
# Attempt to restore previous directory
|
|
159
|
+
Push ""
|
|
160
|
+
Call un.restoreFiles
|
|
161
|
+
Pop $R0
|
|
162
|
+
|
|
163
|
+
Abort `Can't rename "$INSTDIR" to "$PLUGINSDIR\old-install".`
|
|
164
|
+
${endif}
|
|
165
|
+
|
|
166
|
+
${endif}
|
|
167
|
+
|
|
168
|
+
# Remove all files (or remaining shallow directories from the block above)
|
|
169
|
+
RMDir /r $INSTDIR
|
|
170
|
+
!endif
|
|
171
|
+
|
|
41
172
|
${ifNot} ${isKeepShortcuts}
|
|
42
173
|
WinShell::UninstAppUserModelId "${APP_ID}"
|
|
43
174
|
|
|
@@ -64,13 +195,6 @@ Section "un.install"
|
|
|
64
195
|
!insertmacro unregisterFileAssociations
|
|
65
196
|
!endif
|
|
66
197
|
|
|
67
|
-
# delete the installed files
|
|
68
|
-
!ifmacrodef customRemoveFiles
|
|
69
|
-
!insertmacro customRemoveFiles
|
|
70
|
-
!else
|
|
71
|
-
RMDir /r $INSTDIR
|
|
72
|
-
!endif
|
|
73
|
-
|
|
74
198
|
Var /GLOBAL isDeleteAppData
|
|
75
199
|
StrCpy $isDeleteAppData "0"
|
|
76
200
|
|
package/CHANGELOG.md
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
# app-builder-lib
|
|
2
|
-
|
|
3
|
-
## 22.14.11
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- [#6472](https://github.com/electron-userland/electron-builder/pull/6472) [`e3d06afa`](https://github.com/electron-userland/electron-builder/commit/e3d06afae1236d44e4b6e670b453b260b1f74d84) Thanks [@I-Otsuki](https://github.com/I-Otsuki)! - fix(nsis): Ignore other users processes when installing for only current user
|
|
8
|
-
Closes #6104
|
|
9
|
-
|
|
10
|
-
## 22.14.10
|
|
11
|
-
|
|
12
|
-
### Patch Changes
|
|
13
|
-
|
|
14
|
-
- [#6449](https://github.com/electron-userland/electron-builder/pull/6449) [`df7a4255`](https://github.com/electron-userland/electron-builder/commit/df7a4255d219aea7a1236fd5693f7c13460099ad) Thanks [@saadshahd](https://github.com/saadshahd)! - Enable channel alternation for github publishing provider.
|
|
15
|
-
|
|
16
|
-
## 22.14.9
|
|
17
|
-
|
|
18
|
-
### Patch Changes
|
|
19
|
-
|
|
20
|
-
- [#6450](https://github.com/electron-userland/electron-builder/pull/6450) [`661a6522`](https://github.com/electron-userland/electron-builder/commit/661a6522520e9ea59549cb7e18986fcfb58e873a) Thanks [@robertpatrick](https://github.com/robertpatrick)! - fix(nsis): fix per-machine installs to properly elevate during silent install/updates
|
|
21
|
-
|
|
22
|
-
## 22.14.8
|
|
23
|
-
|
|
24
|
-
### Patch Changes
|
|
25
|
-
|
|
26
|
-
- [#6447](https://github.com/electron-userland/electron-builder/pull/6447) [`d20bcf0c`](https://github.com/electron-userland/electron-builder/commit/d20bcf0cea4e4cb49aab08f820131a2d6b083a2c) Thanks [@mmaietta](https://github.com/mmaietta)! - fix(nsis): downgrade nsis from v3.0.4.2 to v3.0.4.1 due to (#6334)
|
|
27
|
-
|
|
28
|
-
## 22.14.7
|
|
29
|
-
|
|
30
|
-
### Patch Changes
|
|
31
|
-
|
|
32
|
-
- Updated dependencies [[`04a84352`](https://github.com/electron-userland/electron-builder/commit/04a84352b2b3fbb3c54533a8428bfd103df0af21)]:
|
|
33
|
-
- builder-util@22.14.7
|
|
34
|
-
- electron-publish@22.14.7
|
|
35
|
-
|
|
36
|
-
## 22.14.6
|
|
37
|
-
|
|
38
|
-
### Patch Changes
|
|
39
|
-
|
|
40
|
-
- [#6384](https://github.com/electron-userland/electron-builder/pull/6384) [`5468c188`](https://github.com/electron-userland/electron-builder/commit/5468c188f30f65352ca651e1f5fa9f8915c48c6b) Thanks [@sohobloo](https://github.com/sohobloo)! - fix(linux): If linux executableArgs already contains one of the mutually exclusive(%f / %u / %F / %U) code,don't append %U.
|
|
41
|
-
|
|
42
|
-
* [#6402](https://github.com/electron-userland/electron-builder/pull/6402) [`f41d5f39`](https://github.com/electron-userland/electron-builder/commit/f41d5f397ade8f6199d56bb4275b05a0a0e65bca) Thanks [@zcbenz](https://github.com/zcbenz)! - fix: Since node-gyp >= 8.4.0, building modules for old versions of Electron requires passing --force-process-config due to them lacking a valid config.gypi in their headers.
|
|
43
|
-
|
|
44
|
-
See also nodejs/node-gyp#2497.
|
|
45
|
-
|
|
46
|
-
- [#6400](https://github.com/electron-userland/electron-builder/pull/6400) [`66ca625f`](https://github.com/electron-userland/electron-builder/commit/66ca625f892329fd7bedf52fddc6659ec83b7cd3) Thanks [@jbool24](https://github.com/jbool24)! - refactor: update Bitbucket publisher to have optional config options for Token and Username (Bitbucket Private Repos)
|
|
47
|
-
|
|
48
|
-
- Updated dependencies [[`66ca625f`](https://github.com/electron-userland/electron-builder/commit/66ca625f892329fd7bedf52fddc6659ec83b7cd3)]:
|
|
49
|
-
- builder-util-runtime@8.9.2
|
|
50
|
-
- builder-util@22.14.6
|
|
51
|
-
- electron-publish@22.14.6
|
|
52
|
-
|
|
53
|
-
## 22.14.5
|
|
54
|
-
|
|
55
|
-
### Patch Changes
|
|
56
|
-
|
|
57
|
-
- [#6333](https://github.com/electron-userland/electron-builder/pull/6333) [`54ee4e72`](https://github.com/electron-userland/electron-builder/commit/54ee4e72c5db859b9a00104179786567a0e977ff) Thanks [@lutzroeder](https://github.com/lutzroeder)! - fix: SnapStoreOptions required properties (#6327)
|
|
58
|
-
|
|
59
|
-
- Updated dependencies [[`54ee4e72`](https://github.com/electron-userland/electron-builder/commit/54ee4e72c5db859b9a00104179786567a0e977ff)]:
|
|
60
|
-
- builder-util-runtime@8.9.1
|
|
61
|
-
- builder-util@22.14.5
|
|
62
|
-
- electron-publish@22.14.5
|
|
63
|
-
|
|
64
|
-
## 22.14.4
|
|
65
|
-
|
|
66
|
-
### Patch Changes
|
|
67
|
-
|
|
68
|
-
- [#6308](https://github.com/electron-userland/electron-builder/pull/6308) [`fce1a1fa`](https://github.com/electron-userland/electron-builder/commit/fce1a1fab66e3f5cd741a4cecc4af8377aea9dd8) Thanks [@sr258](https://github.com/sr258)! - The filename of the app icon in macOS is now always 'icon.icns' instead of a derivate of the product name. The reason for this change is that macOS doesn't display icons with non-ASCII characters in their names, which is quite possible in languages other than English.
|
|
69
|
-
|
|
70
|
-
* [#6287](https://github.com/electron-userland/electron-builder/pull/6287) [`10b47273`](https://github.com/electron-userland/electron-builder/commit/10b47273c32c32df17dfb910feb4a7704c83da91) Thanks [@nonesand](https://github.com/nonesand)! - fix: add appCannotBeClosed text for zh_CN
|
|
71
|
-
|
|
72
|
-
- [#6300](https://github.com/electron-userland/electron-builder/pull/6300) [`b7e4c382`](https://github.com/electron-userland/electron-builder/commit/b7e4c382984bac874f63b83e0db91d875566a550) Thanks [@indutny-signal](https://github.com/indutny-signal)! - chore(nsis): fix i18n of appCannotBeClosed
|
|
73
|
-
|
|
74
|
-
* [#6309](https://github.com/electron-userland/electron-builder/pull/6309) [`e29a6b8b`](https://github.com/electron-userland/electron-builder/commit/e29a6b8b36695a2ed9d2f9a57e4c1c74587d1b16) Thanks [@GCKPaulYang](https://github.com/GCKPaulYang)! - fix: update assistedMessages.yml
|
|
75
|
-
|
|
76
|
-
- [#6293](https://github.com/electron-userland/electron-builder/pull/6293) [`8ebfc962`](https://github.com/electron-userland/electron-builder/commit/8ebfc96276bffe0bc1ad394c5ae6843976e01709) Thanks [@sr258](https://github.com/sr258)! - Introduced env var to allow custom username for Bitbucket publish. This allows you to user a username different from the owner. No changes to interfaces or signatures that require changes in consumers.
|
|
77
|
-
|
|
78
|
-
## 22.14.3
|
|
79
|
-
|
|
80
|
-
### Patch Changes
|
|
81
|
-
|
|
82
|
-
- [#6247](https://github.com/electron-userland/electron-builder/pull/6247) [`a9ec90d5`](https://github.com/electron-userland/electron-builder/commit/a9ec90d539fdbb5786692629275b1a89bfd7aec4) Thanks [@erikrz](https://github.com/erikrz)! - fix (msi): broken shortcut icon for desktop and startup entry (#5965)
|
|
83
|
-
|
|
84
|
-
* [#6277](https://github.com/electron-userland/electron-builder/pull/6277) [`b83d4ea7`](https://github.com/electron-userland/electron-builder/commit/b83d4ea778893f692c0405670a774d645602f063) Thanks [@indutny-signal](https://github.com/indutny-signal)! - chore(nsis): internationalize appCannotBeClosed
|
|
85
|
-
|
|
86
|
-
## 22.14.2
|
|
87
|
-
|
|
88
|
-
### Patch Changes
|
|
89
|
-
|
|
90
|
-
- [#6248](https://github.com/electron-userland/electron-builder/pull/6248) [`f3590355`](https://github.com/electron-userland/electron-builder/commit/f3590355c61dab05a6c92c5951aae8e59503d693) Thanks [@mmaietta](https://github.com/mmaietta)! - fix: dmg-license as an optional dependency while still enabling docs site to build properly
|
|
91
|
-
|
|
92
|
-
## 22.14.1
|
|
93
|
-
|
|
94
|
-
### Patch Changes
|
|
95
|
-
|
|
96
|
-
- [#6244](https://github.com/electron-userland/electron-builder/pull/6244) [`8ccb2da5`](https://github.com/electron-userland/electron-builder/commit/8ccb2da5d4c641b971f6a7403d3b2e3a3b844a05) Thanks [@mmaietta](https://github.com/mmaietta)! - fix: dmg-license optional dependency
|
|
97
|
-
|
|
98
|
-
## 22.14.0
|
|
99
|
-
|
|
100
|
-
### Minor Changes
|
|
101
|
-
|
|
102
|
-
- [#6228](https://github.com/electron-userland/electron-builder/pull/6228) [`a9453216`](https://github.com/electron-userland/electron-builder/commit/a94532164709a545c0f6551fdc336dbc5377bda8) Thanks [@mmaietta](https://github.com/mmaietta)! - feat: adding Bitbucket publisher and autoupdater
|
|
103
|
-
|
|
104
|
-
### Patch Changes
|
|
105
|
-
|
|
106
|
-
- Updated dependencies [[`a9453216`](https://github.com/electron-userland/electron-builder/commit/a94532164709a545c0f6551fdc336dbc5377bda8)]:
|
|
107
|
-
- builder-util-runtime@8.9.0
|
|
108
|
-
- builder-util@22.14.0
|
|
109
|
-
- electron-publish@22.14.0
|
|
110
|
-
|
|
111
|
-
## 22.13.1
|
|
112
|
-
|
|
113
|
-
### Patch Changes
|
|
114
|
-
|
|
115
|
-
- [#6185](https://github.com/electron-userland/electron-builder/pull/6185) [`f6a30535`](https://github.com/electron-userland/electron-builder/commit/f6a3053563bd50dc77010d2910086c81acdf613e) Thanks [@mmaietta](https://github.com/mmaietta)! - fix: Support Windows 11 in VMs
|
|
116
|
-
|
|
117
|
-
* [#6193](https://github.com/electron-userland/electron-builder/pull/6193) [`7f933d00`](https://github.com/electron-userland/electron-builder/commit/7f933d0004a0a5f808a2a1c71dca7362cab2728e) Thanks [@mmaietta](https://github.com/mmaietta)! - fix: adding snapStore to AllPublishOptions so that it properly is generated via `pnpm schema`
|
|
118
|
-
|
|
119
|
-
* Updated dependencies [[`7f933d00`](https://github.com/electron-userland/electron-builder/commit/7f933d0004a0a5f808a2a1c71dca7362cab2728e)]:
|
|
120
|
-
- builder-util-runtime@8.8.1
|
|
121
|
-
- builder-util@22.13.1
|
|
122
|
-
- electron-publish@22.13.1
|
|
123
|
-
|
|
124
|
-
## 22.13.0
|
|
125
|
-
|
|
126
|
-
### Minor Changes
|
|
127
|
-
|
|
128
|
-
- [#6176](https://github.com/electron-userland/electron-builder/pull/6176) [`6f42f646`](https://github.com/electron-userland/electron-builder/commit/6f42f646c9d36405c9d69ca45dda51baabdec4bd) Thanks [@gaodeng](https://github.com/gaodeng)! - feat: add `beforePack` hook to build process with the same payload interface as that of `afterPack`
|
|
129
|
-
|
|
130
|
-
* [#6167](https://github.com/electron-userland/electron-builder/pull/6167) [`f45110cb`](https://github.com/electron-userland/electron-builder/commit/f45110cbf66572d5748d21fc24dc26cabd06f35f) Thanks [@mmaietta](https://github.com/mmaietta)! - feat: Adding Keygen as an official publisher/updater for electron-builder (#6167)
|
|
131
|
-
|
|
132
|
-
### Patch Changes
|
|
133
|
-
|
|
134
|
-
- Updated dependencies [[`f45110cb`](https://github.com/electron-userland/electron-builder/commit/f45110cbf66572d5748d21fc24dc26cabd06f35f)]:
|
|
135
|
-
- builder-util@22.13.0
|
|
136
|
-
- builder-util-runtime@8.8.0
|
|
137
|
-
- electron-publish@22.13.0
|
|
138
|
-
|
|
139
|
-
## 22.12.1
|
|
140
|
-
|
|
141
|
-
### Patch Changes
|
|
142
|
-
|
|
143
|
-
- c02ccbb9: fix: replace deprecated `--cache-min` option and use `--prefer-offline`
|
|
144
|
-
- Updated dependencies [6c945bd5]
|
|
145
|
-
- builder-util@22.12.1
|
|
146
|
-
- electron-publish@22.12.1
|
|
147
|
-
|
|
148
|
-
## 22.12.0
|
|
149
|
-
|
|
150
|
-
### Minor Changes
|
|
151
|
-
|
|
152
|
-
- 14974114: feat(nsis portable): Adding support for unique dir on each portable app launch
|
|
153
|
-
- a99a7c87: feat: allowing custom makensis url to be specified and adding flag to enable debug logging for NSIS scripts
|
|
154
|
-
|
|
155
|
-
## 22.11.11
|
|
156
|
-
|
|
157
|
-
### Patch Changes
|
|
158
|
-
|
|
159
|
-
- a4eae34f: Synchronizing CLI and package.json versions. Updating auto-publish values + changeset generation to be more frictionless
|
|
160
|
-
- 4a177dc0: fix(mac): Adding Developer ID Application entry for development signing when building not a mas target. Fixes: #6094
|
|
161
|
-
fix(mac): Removing 3rd Party Mac Developer Application certificate selector. Fixes: #6101
|
|
162
|
-
- Updated dependencies [a4eae34f]
|
|
163
|
-
- builder-util@22.11.11
|
|
164
|
-
- builder-util-runtime@8.7.10
|
|
165
|
-
- electron-publish@22.11.11
|
|
166
|
-
|
|
167
|
-
## 22.11.10
|
|
168
|
-
|
|
169
|
-
### Patch Changes
|
|
170
|
-
|
|
171
|
-
- 72ffc250: fix: App file walker including all node modules when a `node_modules/___` glob pattern is specified in `files` config (#6045)
|
|
172
|
-
- 878671d0: Updating patch number as many deps were updated as parted of RenovateBot integration
|
|
173
|
-
- Updated dependencies [878671d0]
|
|
174
|
-
- builder-util-runtime@8.7.9
|
|
175
|
-
- builder-util@22.11.10
|
|
176
|
-
- electron-publish@22.11.10
|
|
177
|
-
|
|
178
|
-
## 22.11.9
|
|
179
|
-
|
|
180
|
-
### Patch Changes
|
|
181
|
-
|
|
182
|
-
- 1272afc5: Initial introduction of changset config
|
|
183
|
-
- Updated dependencies [1272afc5]
|
|
184
|
-
- builder-util@22.11.9
|
|
185
|
-
- builder-util-runtime@8.7.8
|
|
186
|
-
- electron-publish@22.11.9
|
package/LICENSE
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2015 Loopline Systems
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Arch } from "builder-util";
|
|
3
|
-
import { BintrayOptions } from "builder-util-runtime";
|
|
4
|
-
import { ClientRequest } from "http";
|
|
5
|
-
import { HttpPublisher, PublishContext, PublishOptions } from "electron-publish";
|
|
6
|
-
export declare class BintrayPublisher extends HttpPublisher {
|
|
7
|
-
private readonly version;
|
|
8
|
-
private readonly options;
|
|
9
|
-
private readonly _versionPromise;
|
|
10
|
-
private readonly client;
|
|
11
|
-
readonly providerName = "Bintray";
|
|
12
|
-
constructor(context: PublishContext, info: BintrayOptions, version: string, options?: PublishOptions);
|
|
13
|
-
private init;
|
|
14
|
-
protected doUpload(fileName: string, arch: Arch, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void): Promise<any>;
|
|
15
|
-
deleteRelease(isForce?: boolean): Promise<void>;
|
|
16
|
-
toString(): string;
|
|
17
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BintrayPublisher = void 0;
|
|
4
|
-
const builder_util_1 = require("builder-util");
|
|
5
|
-
const builder_util_runtime_1 = require("builder-util-runtime");
|
|
6
|
-
const bintray_1 = require("builder-util-runtime/out/bintray");
|
|
7
|
-
const nodeHttpExecutor_1 = require("builder-util/out/nodeHttpExecutor");
|
|
8
|
-
const lazy_val_1 = require("lazy-val");
|
|
9
|
-
const electron_publish_1 = require("electron-publish");
|
|
10
|
-
class BintrayPublisher extends electron_publish_1.HttpPublisher {
|
|
11
|
-
constructor(context, info, version, options = {}) {
|
|
12
|
-
super(context);
|
|
13
|
-
this.version = version;
|
|
14
|
-
this.options = options;
|
|
15
|
-
this._versionPromise = new lazy_val_1.Lazy(() => this.init());
|
|
16
|
-
this.providerName = "Bintray";
|
|
17
|
-
let token = info.token;
|
|
18
|
-
if (builder_util_1.isEmptyOrSpaces(token)) {
|
|
19
|
-
token = process.env.BT_TOKEN;
|
|
20
|
-
if (builder_util_1.isEmptyOrSpaces(token)) {
|
|
21
|
-
throw new builder_util_1.InvalidConfigurationError(`Bintray token is not set, neither programmatically, nor using env "BT_TOKEN" (see https://www.electron.build/configuration/publish#bintrayoptions)`);
|
|
22
|
-
}
|
|
23
|
-
token = token.trim();
|
|
24
|
-
if (!builder_util_1.isTokenCharValid(token)) {
|
|
25
|
-
throw new builder_util_1.InvalidConfigurationError(`Bintray token (${JSON.stringify(token)}) contains invalid characters, please check env "BT_TOKEN"`);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
this.client = new bintray_1.BintrayClient(info, nodeHttpExecutor_1.httpExecutor, this.context.cancellationToken, token);
|
|
29
|
-
}
|
|
30
|
-
async init() {
|
|
31
|
-
try {
|
|
32
|
-
return await this.client.getVersion(this.version);
|
|
33
|
-
}
|
|
34
|
-
catch (e) {
|
|
35
|
-
if (e instanceof builder_util_runtime_1.HttpError && e.statusCode === 404) {
|
|
36
|
-
if (this.options.publish !== "onTagOrDraft") {
|
|
37
|
-
builder_util_1.log.info({ version: this.version }, "version doesn't exist, creating one");
|
|
38
|
-
return await this.client.createVersion(this.version);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
builder_util_1.log.warn({ reason: "version doesn't exist", version: this.version }, "skipped publishing");
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
throw e;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
async doUpload(fileName, arch, dataLength, requestProcessor) {
|
|
48
|
-
const version = await this._versionPromise.value;
|
|
49
|
-
if (version == null) {
|
|
50
|
-
builder_util_1.log.warn({ file: fileName, reason: "version doesn't exist and is not created", version: this.version }, "skipped publishing");
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const options = {
|
|
54
|
-
hostname: "api.bintray.com",
|
|
55
|
-
path: `/content/${this.client.owner}/${this.client.repo}/${this.client.packageName}/${encodeURI(`${version.name}/${fileName}`)}`,
|
|
56
|
-
method: "PUT",
|
|
57
|
-
headers: {
|
|
58
|
-
"Content-Length": dataLength,
|
|
59
|
-
"X-Bintray-Override": "1",
|
|
60
|
-
"X-Bintray-Publish": "1",
|
|
61
|
-
"X-Bintray-Debian-Architecture": builder_util_1.toLinuxArchString(arch, "deb"),
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
if (this.client.distribution != null) {
|
|
65
|
-
options.headers["X-Bintray-Debian-Distribution"] = this.client.distribution;
|
|
66
|
-
}
|
|
67
|
-
if (this.client.component != null) {
|
|
68
|
-
options.headers["X-Bintray-Debian-Component"] = this.client.component;
|
|
69
|
-
}
|
|
70
|
-
return builder_util_runtime_1.HttpExecutor.retryOnServerError(() => {
|
|
71
|
-
return nodeHttpExecutor_1.httpExecutor.doApiRequest(builder_util_runtime_1.configureRequestOptions(options, this.client.auth), this.context.cancellationToken, requestProcessor);
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
//noinspection JSUnusedGlobalSymbols
|
|
75
|
-
async deleteRelease(isForce = false) {
|
|
76
|
-
if (!isForce && !this._versionPromise.hasValue) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const version = await this._versionPromise.value;
|
|
80
|
-
if (version != null) {
|
|
81
|
-
await this.client.deleteVersion(version.name);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
toString() {
|
|
85
|
-
return `Bintray (user: ${this.client.user || this.client.owner}, owner: ${this.client.owner}, package: ${this.client.packageName}, repository: ${this.client.repo}, version: ${this.version})`;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
exports.BintrayPublisher = BintrayPublisher;
|
|
89
|
-
//# sourceMappingURL=BintrayPublisher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BintrayPublisher.js","sourceRoot":"","sources":["../../src/publish/BintrayPublisher.ts"],"names":[],"mappings":"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","sourcesContent":["import { Arch, InvalidConfigurationError, isEmptyOrSpaces, isTokenCharValid, log, toLinuxArchString } from \"builder-util\"\nimport { BintrayOptions, configureRequestOptions, HttpError, HttpExecutor } from \"builder-util-runtime\"\nimport { BintrayClient, Version } from \"builder-util-runtime/out/bintray\"\nimport { httpExecutor } from \"builder-util/out/nodeHttpExecutor\"\nimport { ClientRequest, RequestOptions } from \"http\"\nimport { Lazy } from \"lazy-val\"\nimport { HttpPublisher, PublishContext, PublishOptions } from \"electron-publish\"\n\nexport class BintrayPublisher extends HttpPublisher {\n private readonly _versionPromise = new Lazy(() => this.init())\n\n private readonly client: BintrayClient\n\n readonly providerName = \"Bintray\"\n\n constructor(context: PublishContext, info: BintrayOptions, private readonly version: string, private readonly options: PublishOptions = {}) {\n super(context)\n\n let token = info.token\n if (isEmptyOrSpaces(token)) {\n token = process.env.BT_TOKEN\n if (isEmptyOrSpaces(token)) {\n throw new InvalidConfigurationError(\n `Bintray token is not set, neither programmatically, nor using env \"BT_TOKEN\" (see https://www.electron.build/configuration/publish#bintrayoptions)`\n )\n }\n\n token = token.trim()\n\n if (!isTokenCharValid(token)) {\n throw new InvalidConfigurationError(`Bintray token (${JSON.stringify(token)}) contains invalid characters, please check env \"BT_TOKEN\"`)\n }\n }\n\n this.client = new BintrayClient(info, httpExecutor, this.context.cancellationToken, token)\n }\n\n private async init(): Promise<Version | null> {\n try {\n return await this.client.getVersion(this.version)\n } catch (e) {\n if (e instanceof HttpError && e.statusCode === 404) {\n if (this.options.publish !== \"onTagOrDraft\") {\n log.info({ version: this.version }, \"version doesn't exist, creating one\")\n return await this.client.createVersion(this.version)\n } else {\n log.warn({ reason: \"version doesn't exist\", version: this.version }, \"skipped publishing\")\n }\n }\n\n throw e\n }\n }\n\n protected async doUpload(fileName: string, arch: Arch, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void) {\n const version = await this._versionPromise.value\n if (version == null) {\n log.warn({ file: fileName, reason: \"version doesn't exist and is not created\", version: this.version }, \"skipped publishing\")\n return\n }\n\n const options: RequestOptions = {\n hostname: \"api.bintray.com\",\n path: `/content/${this.client.owner}/${this.client.repo}/${this.client.packageName}/${encodeURI(`${version.name}/${fileName}`)}`,\n method: \"PUT\",\n headers: {\n \"Content-Length\": dataLength,\n \"X-Bintray-Override\": \"1\",\n \"X-Bintray-Publish\": \"1\",\n \"X-Bintray-Debian-Architecture\": toLinuxArchString(arch, \"deb\"),\n },\n }\n\n if (this.client.distribution != null) {\n options.headers![\"X-Bintray-Debian-Distribution\"] = this.client.distribution\n }\n\n if (this.client.component != null) {\n options.headers![\"X-Bintray-Debian-Component\"] = this.client.component\n }\n\n return HttpExecutor.retryOnServerError(() => {\n return httpExecutor.doApiRequest(configureRequestOptions(options, this.client.auth), this.context.cancellationToken, requestProcessor)\n })\n }\n\n //noinspection JSUnusedGlobalSymbols\n async deleteRelease(isForce = false): Promise<void> {\n if (!isForce && !this._versionPromise.hasValue) {\n return\n }\n\n const version = await this._versionPromise.value\n if (version != null) {\n await this.client.deleteVersion(version.name)\n }\n }\n\n toString() {\n return `Bintray (user: ${this.client.user || this.client.owner}, owner: ${this.client.owner}, package: ${this.client.packageName}, repository: ${this.client.repo}, version: ${\n this.version\n })`\n }\n}\n"]}
|