Skip to content

Commit

Permalink
fix: Arguments aren't passed to Electron with portable target
Browse files Browse the repository at this point in the history
Close #1410
  • Loading branch information
develar committed Aug 12, 2017
1 parent 7755fa4 commit 4948bd6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/electron-builder/templates/nsis/portable.nsi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
!include "common.nsh"
!include "StdUtils.nsh"

WindowIcon Off
AutoCloseWindow True
Expand All @@ -17,7 +18,8 @@ Section
!insertmacro extractEmbeddedAppPackage

System::Call 'Kernel32::SetEnvironmentVariable(t, t)i ("PORTABLE_EXECUTABLE_DIR", "$EXEDIR").r0'
ExecWait "$INSTDIR\${APP_EXECUTABLE_FILENAME}"
${StdUtils.GetAllParameters} $R0 0
ExecWait "$INSTDIR\${APP_EXECUTABLE_FILENAME} $R0"

SetOutPath $PLUGINSDIR
RMDir /r $INSTDIR
Expand Down
4 changes: 3 additions & 1 deletion test/fixtures/test-app-one/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ <h1>Hello World!</h1>
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.

Env: <script>document.write(JSON.stringify(process.env, null, 2))</script>.
Args: <script>document.write("<br><br><pre>" + JSON.stringify(require("electron").remote.process.argv, null, 2) + "</pre>")</script>.

Env: <script>document.write("<br><br><pre>" + JSON.stringify(process.env, null, 2) + "</pre>")</script>.

<button onclick="saveAppData()">Save app data</button>
</body>
Expand Down
4 changes: 2 additions & 2 deletions test/src/windows/portableTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ test.ifAll.ifNotCiMac("portable", app({
test.ifNotCiMac("portable - artifactName and request execution level", app({
targets: Platform.WINDOWS.createTarget(["portable"]),
config: {
"nsis": {
"artifactName": "${productName}Installer.${version}.${ext}",
nsis: {
artifactName: "${productName}Installer.${version}.${ext}",
installerIcon: "foo test space.ico",
},
portable: {
Expand Down

2 comments on commit 4948bd6

@3n-mb
Copy link

@3n-mb 3n-mb commented on 4948bd6 Jan 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this code in version 20.38, that is currently on npmjs?
Cause parameters are not passed with target=portable on windows.

@3n-mb
Copy link

@3n-mb 3n-mb commented on 4948bd6 Jan 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And/or how can we get v29 from npm?

Please sign in to comment.