app-builder-lib 26.0.18 → 26.0.19
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/codeSign/macCodeSign.js +5 -1
- package/out/codeSign/macCodeSign.js.map +1 -1
- package/out/codeSign/windowsCodeSign.js +17 -12
- package/out/codeSign/windowsCodeSign.js.map +1 -1
- package/out/codeSign/windowsSignToolManager.js +13 -8
- package/out/codeSign/windowsSignToolManager.js.map +1 -1
- package/out/node-module-collector/index.d.ts +3 -2
- package/out/node-module-collector/index.js +9 -16
- package/out/node-module-collector/index.js.map +1 -1
- package/out/node-module-collector/nodeModulesCollector.d.ts +5 -1
- package/out/node-module-collector/nodeModulesCollector.js +90 -6
- package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/out/node-module-collector/npmNodeModulesCollector.d.ts +0 -1
- package/out/node-module-collector/npmNodeModulesCollector.js +2 -2
- package/out/node-module-collector/npmNodeModulesCollector.js.map +1 -1
- package/out/node-module-collector/packageManager.js +5 -2
- package/out/node-module-collector/packageManager.js.map +1 -1
- package/out/node-module-collector/pnpmNodeModulesCollector.d.ts +1 -1
- package/out/node-module-collector/pnpmNodeModulesCollector.js +8 -2
- package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/out/node-module-collector/yarnNodeModulesCollector.d.ts +0 -1
- package/out/node-module-collector/yarnNodeModulesCollector.js +4 -3
- package/out/node-module-collector/yarnNodeModulesCollector.js.map +1 -1
- package/out/util/appFileCopier.js +2 -2
- package/out/util/appFileCopier.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 +8 -8
- package/scheme.json +142 -0
- package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +70 -24
- package/templates/nsis/multiUser.nsh +43 -2
package/scheme.json
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
{
|
|
8
8
|
"$ref": "#/definitions/GithubOptions"
|
|
9
9
|
},
|
|
10
|
+
{
|
|
11
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
12
|
+
},
|
|
10
13
|
{
|
|
11
14
|
"$ref": "#/definitions/S3Options"
|
|
12
15
|
},
|
|
@@ -108,6 +111,9 @@
|
|
|
108
111
|
{
|
|
109
112
|
"$ref": "#/definitions/GithubOptions"
|
|
110
113
|
},
|
|
114
|
+
{
|
|
115
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
116
|
+
},
|
|
111
117
|
{
|
|
112
118
|
"$ref": "#/definitions/S3Options"
|
|
113
119
|
},
|
|
@@ -256,6 +262,9 @@
|
|
|
256
262
|
{
|
|
257
263
|
"$ref": "#/definitions/GithubOptions"
|
|
258
264
|
},
|
|
265
|
+
{
|
|
266
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
267
|
+
},
|
|
259
268
|
{
|
|
260
269
|
"$ref": "#/definitions/S3Options"
|
|
261
270
|
},
|
|
@@ -732,6 +741,9 @@
|
|
|
732
741
|
{
|
|
733
742
|
"$ref": "#/definitions/GithubOptions"
|
|
734
743
|
},
|
|
744
|
+
{
|
|
745
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
746
|
+
},
|
|
735
747
|
{
|
|
736
748
|
"$ref": "#/definitions/S3Options"
|
|
737
749
|
},
|
|
@@ -911,6 +923,9 @@
|
|
|
911
923
|
{
|
|
912
924
|
"$ref": "#/definitions/GithubOptions"
|
|
913
925
|
},
|
|
926
|
+
{
|
|
927
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
928
|
+
},
|
|
914
929
|
{
|
|
915
930
|
"$ref": "#/definitions/S3Options"
|
|
916
931
|
},
|
|
@@ -1270,6 +1285,9 @@
|
|
|
1270
1285
|
{
|
|
1271
1286
|
"$ref": "#/definitions/GithubOptions"
|
|
1272
1287
|
},
|
|
1288
|
+
{
|
|
1289
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
1290
|
+
},
|
|
1273
1291
|
{
|
|
1274
1292
|
"$ref": "#/definitions/S3Options"
|
|
1275
1293
|
},
|
|
@@ -1592,6 +1610,88 @@
|
|
|
1592
1610
|
],
|
|
1593
1611
|
"type": "object"
|
|
1594
1612
|
},
|
|
1613
|
+
"GitlabOptions": {
|
|
1614
|
+
"additionalProperties": false,
|
|
1615
|
+
"description": "[GitLab](https://docs.gitlab.com/ee/user/project/releases/) options.\n\nGitLab [personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) is required for private repositories. You can generate one by going to your GitLab profile settings.\nDefine `GITLAB_TOKEN` environment variable.",
|
|
1616
|
+
"properties": {
|
|
1617
|
+
"channel": {
|
|
1618
|
+
"default": "latest",
|
|
1619
|
+
"description": "The channel.",
|
|
1620
|
+
"type": [
|
|
1621
|
+
"null",
|
|
1622
|
+
"string"
|
|
1623
|
+
]
|
|
1624
|
+
},
|
|
1625
|
+
"host": {
|
|
1626
|
+
"default": "gitlab.com",
|
|
1627
|
+
"description": "The host (including the port if needed).",
|
|
1628
|
+
"type": [
|
|
1629
|
+
"null",
|
|
1630
|
+
"string"
|
|
1631
|
+
]
|
|
1632
|
+
},
|
|
1633
|
+
"projectId": {
|
|
1634
|
+
"description": "The GitLab project ID or namespace/project-name.",
|
|
1635
|
+
"type": [
|
|
1636
|
+
"string",
|
|
1637
|
+
"number"
|
|
1638
|
+
]
|
|
1639
|
+
},
|
|
1640
|
+
"provider": {
|
|
1641
|
+
"const": "gitlab",
|
|
1642
|
+
"description": "The provider. Must be `gitlab`.",
|
|
1643
|
+
"type": "string"
|
|
1644
|
+
},
|
|
1645
|
+
"publishAutoUpdate": {
|
|
1646
|
+
"default": true,
|
|
1647
|
+
"description": "Whether to publish auto update info files.\n\nAuto update relies only on the first provider in the list (you can specify several publishers).\nThus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.",
|
|
1648
|
+
"type": "boolean"
|
|
1649
|
+
},
|
|
1650
|
+
"publisherName": {
|
|
1651
|
+
"anyOf": [
|
|
1652
|
+
{
|
|
1653
|
+
"items": {
|
|
1654
|
+
"type": "string"
|
|
1655
|
+
},
|
|
1656
|
+
"type": "array"
|
|
1657
|
+
},
|
|
1658
|
+
{
|
|
1659
|
+
"type": "null"
|
|
1660
|
+
}
|
|
1661
|
+
]
|
|
1662
|
+
},
|
|
1663
|
+
"requestHeaders": {
|
|
1664
|
+
"$ref": "#/definitions/OutgoingHttpHeaders",
|
|
1665
|
+
"description": "Any custom request headers"
|
|
1666
|
+
},
|
|
1667
|
+
"timeout": {
|
|
1668
|
+
"default": 120000,
|
|
1669
|
+
"description": "Request timeout in milliseconds. (Default is 2 minutes; O is ignored)",
|
|
1670
|
+
"type": [
|
|
1671
|
+
"null",
|
|
1672
|
+
"number"
|
|
1673
|
+
]
|
|
1674
|
+
},
|
|
1675
|
+
"token": {
|
|
1676
|
+
"description": "The access token to support auto-update from private GitLab repositories. Never specify it in the configuration files. Only for [setFeedURL](./auto-update.md#appupdatersetfeedurloptions).",
|
|
1677
|
+
"type": [
|
|
1678
|
+
"null",
|
|
1679
|
+
"string"
|
|
1680
|
+
]
|
|
1681
|
+
},
|
|
1682
|
+
"updaterCacheDirName": {
|
|
1683
|
+
"type": [
|
|
1684
|
+
"null",
|
|
1685
|
+
"string"
|
|
1686
|
+
]
|
|
1687
|
+
}
|
|
1688
|
+
},
|
|
1689
|
+
"required": [
|
|
1690
|
+
"projectId",
|
|
1691
|
+
"provider"
|
|
1692
|
+
],
|
|
1693
|
+
"type": "object"
|
|
1694
|
+
},
|
|
1595
1695
|
"KeygenOptions": {
|
|
1596
1696
|
"additionalProperties": false,
|
|
1597
1697
|
"description": "Keygen options.\nhttps://keygen.sh/\nDefine `KEYGEN_TOKEN` environment variable.",
|
|
@@ -2001,6 +2101,9 @@
|
|
|
2001
2101
|
{
|
|
2002
2102
|
"$ref": "#/definitions/GithubOptions"
|
|
2003
2103
|
},
|
|
2104
|
+
{
|
|
2105
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
2106
|
+
},
|
|
2004
2107
|
{
|
|
2005
2108
|
"$ref": "#/definitions/S3Options"
|
|
2006
2109
|
},
|
|
@@ -2273,6 +2376,9 @@
|
|
|
2273
2376
|
{
|
|
2274
2377
|
"$ref": "#/definitions/GithubOptions"
|
|
2275
2378
|
},
|
|
2379
|
+
{
|
|
2380
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
2381
|
+
},
|
|
2276
2382
|
{
|
|
2277
2383
|
"$ref": "#/definitions/S3Options"
|
|
2278
2384
|
},
|
|
@@ -2778,6 +2884,9 @@
|
|
|
2778
2884
|
{
|
|
2779
2885
|
"$ref": "#/definitions/GithubOptions"
|
|
2780
2886
|
},
|
|
2887
|
+
{
|
|
2888
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
2889
|
+
},
|
|
2781
2890
|
{
|
|
2782
2891
|
"$ref": "#/definitions/S3Options"
|
|
2783
2892
|
},
|
|
@@ -3410,6 +3519,9 @@
|
|
|
3410
3519
|
{
|
|
3411
3520
|
"$ref": "#/definitions/GithubOptions"
|
|
3412
3521
|
},
|
|
3522
|
+
{
|
|
3523
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
3524
|
+
},
|
|
3413
3525
|
{
|
|
3414
3526
|
"$ref": "#/definitions/S3Options"
|
|
3415
3527
|
},
|
|
@@ -3692,6 +3804,9 @@
|
|
|
3692
3804
|
{
|
|
3693
3805
|
"$ref": "#/definitions/GithubOptions"
|
|
3694
3806
|
},
|
|
3807
|
+
{
|
|
3808
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
3809
|
+
},
|
|
3695
3810
|
{
|
|
3696
3811
|
"$ref": "#/definitions/S3Options"
|
|
3697
3812
|
},
|
|
@@ -3818,6 +3933,9 @@
|
|
|
3818
3933
|
{
|
|
3819
3934
|
"$ref": "#/definitions/GithubOptions"
|
|
3820
3935
|
},
|
|
3936
|
+
{
|
|
3937
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
3938
|
+
},
|
|
3821
3939
|
{
|
|
3822
3940
|
"$ref": "#/definitions/S3Options"
|
|
3823
3941
|
},
|
|
@@ -4095,6 +4213,9 @@
|
|
|
4095
4213
|
{
|
|
4096
4214
|
"$ref": "#/definitions/GithubOptions"
|
|
4097
4215
|
},
|
|
4216
|
+
{
|
|
4217
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
4218
|
+
},
|
|
4098
4219
|
{
|
|
4099
4220
|
"$ref": "#/definitions/S3Options"
|
|
4100
4221
|
},
|
|
@@ -4443,6 +4564,9 @@
|
|
|
4443
4564
|
{
|
|
4444
4565
|
"$ref": "#/definitions/GithubOptions"
|
|
4445
4566
|
},
|
|
4567
|
+
{
|
|
4568
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
4569
|
+
},
|
|
4446
4570
|
{
|
|
4447
4571
|
"$ref": "#/definitions/S3Options"
|
|
4448
4572
|
},
|
|
@@ -5194,6 +5318,9 @@
|
|
|
5194
5318
|
{
|
|
5195
5319
|
"$ref": "#/definitions/GithubOptions"
|
|
5196
5320
|
},
|
|
5321
|
+
{
|
|
5322
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
5323
|
+
},
|
|
5197
5324
|
{
|
|
5198
5325
|
"$ref": "#/definitions/S3Options"
|
|
5199
5326
|
},
|
|
@@ -5310,6 +5437,9 @@
|
|
|
5310
5437
|
{
|
|
5311
5438
|
"$ref": "#/definitions/GithubOptions"
|
|
5312
5439
|
},
|
|
5440
|
+
{
|
|
5441
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
5442
|
+
},
|
|
5313
5443
|
{
|
|
5314
5444
|
"$ref": "#/definitions/S3Options"
|
|
5315
5445
|
},
|
|
@@ -5867,6 +5997,9 @@
|
|
|
5867
5997
|
{
|
|
5868
5998
|
"$ref": "#/definitions/GithubOptions"
|
|
5869
5999
|
},
|
|
6000
|
+
{
|
|
6001
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
6002
|
+
},
|
|
5870
6003
|
{
|
|
5871
6004
|
"$ref": "#/definitions/S3Options"
|
|
5872
6005
|
},
|
|
@@ -6177,6 +6310,9 @@
|
|
|
6177
6310
|
{
|
|
6178
6311
|
"$ref": "#/definitions/GithubOptions"
|
|
6179
6312
|
},
|
|
6313
|
+
{
|
|
6314
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
6315
|
+
},
|
|
6180
6316
|
{
|
|
6181
6317
|
"$ref": "#/definitions/S3Options"
|
|
6182
6318
|
},
|
|
@@ -6588,6 +6724,9 @@
|
|
|
6588
6724
|
{
|
|
6589
6725
|
"$ref": "#/definitions/GithubOptions"
|
|
6590
6726
|
},
|
|
6727
|
+
{
|
|
6728
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
6729
|
+
},
|
|
6591
6730
|
{
|
|
6592
6731
|
"$ref": "#/definitions/S3Options"
|
|
6593
6732
|
},
|
|
@@ -7624,6 +7763,9 @@
|
|
|
7624
7763
|
{
|
|
7625
7764
|
"$ref": "#/definitions/GithubOptions"
|
|
7626
7765
|
},
|
|
7766
|
+
{
|
|
7767
|
+
"$ref": "#/definitions/GitlabOptions"
|
|
7768
|
+
},
|
|
7627
7769
|
{
|
|
7628
7770
|
"$ref": "#/definitions/S3Options"
|
|
7629
7771
|
},
|
|
@@ -30,22 +30,77 @@
|
|
|
30
30
|
!macroend
|
|
31
31
|
|
|
32
32
|
!macro CHECK_APP_RUNNING
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
Var /GLOBAL CmdPath
|
|
34
|
+
Var /GLOBAL FindPath
|
|
35
|
+
Var /GLOBAL PowerShellPath
|
|
36
|
+
!ifmacrodef customCheckAppRunning
|
|
37
|
+
!insertmacro customCheckAppRunning
|
|
38
|
+
!else
|
|
39
|
+
StrCpy $CmdPath "$SYSDIR\cmd.exe"
|
|
40
|
+
StrCpy $FindPath "$SYSDIR\find.exe"
|
|
41
|
+
StrCpy $PowerShellPath "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe"
|
|
42
|
+
!insertmacro IS_POWERSHELL_AVAILABLE
|
|
43
|
+
!insertmacro _CHECK_APP_RUNNING
|
|
44
|
+
!endif
|
|
45
|
+
!macroend
|
|
46
|
+
|
|
47
|
+
!macro IS_POWERSHELL_AVAILABLE
|
|
48
|
+
Var /GLOBAL IsPowerShellAvailable ; 0 = available, 1 = not available
|
|
49
|
+
# Try running PowerShell with a simple command to check if it's available
|
|
50
|
+
nsExec::Exec `"$PowerShellPath" -C "if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) { exit 0 } else { exit 1 }"`
|
|
51
|
+
Pop $0 # Return code (0 = success, other = error)
|
|
52
|
+
|
|
53
|
+
${if} $0 == 0
|
|
54
|
+
# PowerShell is available, check if it's not blocked by policies
|
|
55
|
+
nsExec::Exec `"$PowerShellPath" -C "if ((Get-ExecutionPolicy -Scope Process) -eq 'Restricted') { exit 1 } else { exit 0 }"`
|
|
56
|
+
Pop $0
|
|
57
|
+
${endIf}
|
|
58
|
+
|
|
59
|
+
${if} $0 != 0
|
|
60
|
+
StrCpy $0 1
|
|
61
|
+
${endIf}
|
|
62
|
+
|
|
63
|
+
StrCpy $IsPowerShellAvailable $0
|
|
64
|
+
!macroend
|
|
65
|
+
|
|
66
|
+
!macro FIND_PROCESS _FILE _RETURN
|
|
67
|
+
${if} $IsPowerShellAvailable == 0
|
|
68
|
+
nsExec::Exec `"$PowerShellPath" -C "if ((Get-CimInstance -ClassName Win32_Process | ? {$$_.Path -and $$_.Path.StartsWith('$INSTDIR', 'CurrentCultureIgnoreCase')}).Count -gt 0) { exit 0 } else { exit 1 }"`
|
|
69
|
+
Pop ${_RETURN}
|
|
70
|
+
${else}
|
|
71
|
+
!ifdef INSTALL_MODE_PER_ALL_USERS
|
|
72
|
+
${nsProcess::FindProcess} "${_FILE}" ${_RETURN}
|
|
35
73
|
!else
|
|
36
|
-
|
|
74
|
+
# find process owned by current user
|
|
75
|
+
nsExec::Exec `"$CmdPath" /C tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq ${_FILE}" /FO CSV | "$FindPath" "${_FILE}"`
|
|
76
|
+
Pop ${_RETURN}
|
|
37
77
|
!endif
|
|
78
|
+
${endIf}
|
|
38
79
|
!macroend
|
|
39
80
|
|
|
40
|
-
!macro
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
81
|
+
!macro KILL_PROCESS _FILE _FORCE
|
|
82
|
+
Push $0
|
|
83
|
+
${if} ${_FORCE} == 1
|
|
84
|
+
${if} $IsPowerShellAvailable == 0
|
|
85
|
+
StrCpy $0 "-Force"
|
|
86
|
+
${else}
|
|
87
|
+
StrCpy $0 "/F"
|
|
88
|
+
${endIf}
|
|
89
|
+
${else}
|
|
90
|
+
StrCpy $0 ""
|
|
91
|
+
${endIf}
|
|
92
|
+
|
|
93
|
+
${if} $IsPowerShellAvailable == 0
|
|
94
|
+
nsExec::Exec `"$PowerShellPath" -C "Get-CimInstance -ClassName Win32_Process | ? {$$_.Path -and $$_.Path.StartsWith('$INSTDIR', 'CurrentCultureIgnoreCase')} | % { Stop-Process -Id $$_.ProcessId $0 }"`
|
|
95
|
+
${else}
|
|
96
|
+
!ifdef INSTALL_MODE_PER_ALL_USERS
|
|
97
|
+
nsExec::Exec `taskkill /IM "${_FILE}" /FI "PID ne $pid"`
|
|
98
|
+
!else
|
|
99
|
+
nsExec::Exec `"$CmdPath" /C taskkill $0 /IM "${_FILE}" /FI "PID ne $pid" /FI "USERNAME eq %USERNAME%"`
|
|
100
|
+
!endif
|
|
101
|
+
${endIf}
|
|
102
|
+
Pop $0
|
|
103
|
+
!macroend
|
|
49
104
|
|
|
50
105
|
!macro _CHECK_APP_RUNNING
|
|
51
106
|
${GetProcessInfo} 0 $pid $1 $2 $3 $4
|
|
@@ -69,12 +124,7 @@
|
|
|
69
124
|
|
|
70
125
|
DetailPrint "$(appClosing)"
|
|
71
126
|
|
|
72
|
-
|
|
73
|
-
!ifdef INSTALL_MODE_PER_ALL_USERS
|
|
74
|
-
nsExec::Exec `taskkill /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid"`
|
|
75
|
-
!else
|
|
76
|
-
nsExec::Exec `"$SYSDIR\cmd.exe" /c taskkill /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid" /fi "USERNAME eq %USERNAME%"`
|
|
77
|
-
!endif
|
|
127
|
+
!insertmacro KILL_PROCESS "${APP_EXECUTABLE_FILENAME}" 0
|
|
78
128
|
# to ensure that files are not "in-use"
|
|
79
129
|
Sleep 300
|
|
80
130
|
|
|
@@ -88,13 +138,9 @@
|
|
|
88
138
|
${if} $R0 == 0
|
|
89
139
|
# wait to give a chance to exit gracefully
|
|
90
140
|
Sleep 1000
|
|
91
|
-
!
|
|
92
|
-
nsExec::Exec `taskkill /f /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid"`
|
|
93
|
-
!else
|
|
94
|
-
nsExec::Exec `"$SYSDIR\cmd.exe" /c taskkill /f /im "${APP_EXECUTABLE_FILENAME}" /fi "PID ne $pid" /fi "USERNAME eq %USERNAME%"`
|
|
95
|
-
!endif
|
|
141
|
+
!insertmacro KILL_PROCESS "${APP_EXECUTABLE_FILENAME}" 1 # 1 = force kill
|
|
96
142
|
!insertmacro FIND_PROCESS "${APP_EXECUTABLE_FILENAME}" $R0
|
|
97
|
-
${
|
|
143
|
+
${if} $R0 == 0
|
|
98
144
|
DetailPrint `Waiting for "${PRODUCT_NAME}" to close.`
|
|
99
145
|
Sleep 2000
|
|
100
146
|
${else}
|
|
@@ -41,7 +41,7 @@ Var installMode
|
|
|
41
41
|
${endif}
|
|
42
42
|
|
|
43
43
|
# allow /D switch to override installation path https://github.com/electron-userland/electron-builder/issues/1551
|
|
44
|
-
|
|
44
|
+
!insertmacro GetDParameter $R0
|
|
45
45
|
${If} $R0 != ""
|
|
46
46
|
StrCpy $INSTDIR $R0
|
|
47
47
|
${endif}
|
|
@@ -84,10 +84,51 @@ Var installMode
|
|
|
84
84
|
${endif}
|
|
85
85
|
|
|
86
86
|
# allow /D switch to override installation path https://github.com/electron-userland/electron-builder/issues/1551
|
|
87
|
-
|
|
87
|
+
!insertmacro GetDParameter $R0
|
|
88
88
|
${If} $R0 != ""
|
|
89
89
|
StrCpy $INSTDIR $R0
|
|
90
90
|
${endif}
|
|
91
91
|
|
|
92
92
|
!macroend
|
|
93
93
|
!endif
|
|
94
|
+
|
|
95
|
+
# Custom function to handle /D parameter with spaces
|
|
96
|
+
# The /D parameter is special in NSIS - it must be the last parameter and cannot have quotes
|
|
97
|
+
# Use StdUtils.GetParameter to get the full command line, then parse /D= manually
|
|
98
|
+
!macro GetDParameter outVar
|
|
99
|
+
Push $R8
|
|
100
|
+
Push $R9
|
|
101
|
+
Push $R7
|
|
102
|
+
Push $R6
|
|
103
|
+
Push $R5
|
|
104
|
+
|
|
105
|
+
# Get the complete command line using StdUtils (including /D parameter)
|
|
106
|
+
${StdUtils.GetAllParameters} $R8 "0"
|
|
107
|
+
|
|
108
|
+
# Initialize result
|
|
109
|
+
StrCpy $R9 ""
|
|
110
|
+
|
|
111
|
+
# Search for /D= or /d= using a simple loop
|
|
112
|
+
StrLen $R7 $R8
|
|
113
|
+
IntOp $R7 $R7 - 2 # Don't check last 2 characters
|
|
114
|
+
StrCpy $R6 0
|
|
115
|
+
|
|
116
|
+
${Do}
|
|
117
|
+
StrCpy $R5 $R8 3 $R6 # Get 3 characters starting at position $R6
|
|
118
|
+
${If} $R5 == "/D="
|
|
119
|
+
${OrIf} $R5 == "/d="
|
|
120
|
+
# Found /D= or /d=, extract everything after it
|
|
121
|
+
IntOp $R6 $R6 + 3
|
|
122
|
+
StrCpy $R9 $R8 "" $R6
|
|
123
|
+
${Break}
|
|
124
|
+
${EndIf}
|
|
125
|
+
IntOp $R6 $R6 + 1
|
|
126
|
+
${LoopUntil} $R6 > $R7
|
|
127
|
+
|
|
128
|
+
StrCpy ${outVar} $R9
|
|
129
|
+
Pop $R5
|
|
130
|
+
Pop $R6
|
|
131
|
+
Pop $R7
|
|
132
|
+
Pop $R9
|
|
133
|
+
Pop $R8
|
|
134
|
+
!macroend
|