Skip to content
Permalink
Browse files

feat(portable): constant unpack path across all launches of the same …

…executable

Close #3799
  • Loading branch information...
develar committed Apr 4, 2019
1 parent 2b1f0ad commit 3be0181514b88f16386aab1b7645d7e89d493147
@@ -114,6 +114,8 @@
<w>epipe</w>
<w>evolvehq</w>
<w>exdev</w>
<w>exedir</w>
<w>exepath</w>
<w>exitdialogoptionalcheckbox</w>
<w>exitdialogoptionalcheckboxtext</w>
<w>extname</w>
@@ -187,6 +189,7 @@
<w>kext</w>
<w>keyserver</w>
<w>keytar</w>
<w>ksuid</w>
<w>langs</w>
<w>launchui</w>
<w>lcid</w>
@@ -32,7 +32,7 @@
"dependencies": {
"7zip-bin": "~4.1.0",
"@types/is-ci": "^1.1.0",
"app-builder-bin": "2.6.5",
"app-builder-bin": "2.6.6",
"archiver": "^3.0.0",
"async-exit-hook": "^2.0.1",
"bluebird-lst": "^1.0.7",
@@ -42,7 +42,7 @@
"homepage": "https://github.com/electron-userland/electron-builder",
"dependencies": {
"7zip-bin": "~4.1.0",
"app-builder-bin": "2.6.5",
"app-builder-bin": "2.6.6",
"async-exit-hook": "^2.0.1",
"bluebird-lst": "^1.0.7",
"chromium-pickle-js": "^0.2.0",
@@ -19,7 +19,6 @@ export default class AppImageTarget extends Target {
constructor(ignored: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) {
super("appImage")

// we add X-AppImage-BuildId to ensure that new desktop file will be installed
this.desktopEntry = new Lazy<string>(() => helper.computeDesktopEntry(this.options, "AppRun", {
"X-AppImage-Version": `${packager.appInfo.buildVersion}`,
}))
@@ -1,6 +1,6 @@
import { path7za } from "7zip-bin"
import BluebirdPromise from "bluebird-lst"
import { Arch, asArray, AsyncTaskManager, getPlatformIconFileName, InvalidConfigurationError, log, spawnAndWrite, use, exec } from "builder-util"
import { executeAppBuilder, Arch, asArray, AsyncTaskManager, getPlatformIconFileName, InvalidConfigurationError, log, spawnAndWrite, use, exec } from "builder-util"
import { PackageFileInfo, UUID, CURRENT_APP_PACKAGE_FILE_NAME, CURRENT_APP_INSTALLER_FILE_NAME } from "builder-util-runtime"
import { getBinFromGithub } from "../../binDownload"
import { statOrNull, walk } from "builder-util/out/fs"
@@ -228,6 +228,7 @@ export class NsisTarget extends Target {
this.configureDefinesForAllTypeOfInstaller(defines)
if (isPortable) {
defines.REQUEST_EXECUTION_LEVEL = (options as PortableOptions).requestExecutionLevel || "user"
defines.UNPACK_DIR_NAME = await executeAppBuilder(["ksuid"])
}
else {
await this.configureDefines(oneClick, defines)
@@ -12,7 +12,8 @@ Function .onInit
FunctionEnd

Section
StrCpy $INSTDIR $PLUGINSDIR\app
StrCpy $INSTDIR "$TEMP\${UNPACK_DIR_NAME}"
RMDir /r $INSTDIR
SetOutPath $INSTDIR

!ifdef APP_DIR_64
@@ -38,7 +39,7 @@ Section
System::Call 'Kernel32::SetEnvironmentVariable(t, t)i ("PORTABLE_EXECUTABLE_APP_FILENAME", "${APP_FILENAME}").r0'
${StdUtils.GetAllParameters} $R0 0
ExecWait "$INSTDIR\${APP_EXECUTABLE_FILENAME} $R0" $0
SetErrorlevel $0
SetErrorLevel $0

SetOutPath $PLUGINSDIR
RMDir /r $INSTDIR
@@ -119,16 +119,19 @@ export class UUID {

// according to rfc4122#section-4.1.1
function getVariant(bits: number) {
switch (bits) {
case 0: case 1: case 3:
return "ncs"
case 4: case 5:
return "rfc4122"
case 6:
return "microsoft"
default:
return "future"
}
switch (bits) {
case 0:
case 1:
case 3:
return "ncs"
case 4:
case 5:
return "rfc4122"
case 6:
return "microsoft"
default:
return "future"
}
}

enum UuidEncoding {
@@ -11,7 +11,7 @@
"out"
],
"dependencies": {
"app-builder-bin": "2.6.5",
"app-builder-bin": "2.6.6",
"temp-file": "^3.3.2",
"fs-extra-p": "^7.0.1",
"is-ci": "^2.0.0",
@@ -1319,10 +1319,10 @@ anymatch@^2.0.0:
micromatch "^3.1.4"
normalize-path "^2.1.1"

app-builder-bin@2.6.5:
version "2.6.5"
resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-2.6.5.tgz#f763464aea3b4bed406e270d218cf7bc9d11c42e"
integrity sha512-6e0Zj0lTTZ1UpB8Tc1V0uUwuCiosdfyo+xMIwY5ASveyRU8Gy3Ge6wVmdalPtqySKcZc8AvXmEa7irFLcOCGMQ==
app-builder-bin@2.6.6:
version "2.6.6"
resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-2.6.6.tgz#904b0576a510047d03f63c8a02c38eef47871180"
integrity sha512-G0Ee6xkbxV+fvM/7xXWIgSDjWAD4E/d/aNbxerq/TVsCyBIau/0VPmrEqBMyZv0NbTwLDW5aF/yHG+0ZEY77kA==

append-transform@^1.0.0:
version "1.0.0"

0 comments on commit 3be0181

Please sign in to comment.
You can’t perform that action at this time.