Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can portable app using a random folder to decompress the application #4105

Closed
xalc opened this issue Jul 29, 2019 · 5 comments
Closed

Can portable app using a random folder to decompress the application #4105

xalc opened this issue Jul 29, 2019 · 5 comments
Labels

Comments

@xalc
Copy link

xalc commented Jul 29, 2019

  • 21.1.5
  • Windows

Using build script below to build a windows portable app with some extraResources

"build": {
    "productName": "App",
    "extraResources": [
      "./resourFolder/**/*"
    ],
    "files": [
      "!resources/*"
    ],
    "portable": {
      "requestExecutionLevel": "admin"
    },
    "win": {
      "target": "portable",
      "icon": "./src/resources/images/icon.ico",
      "artifactName": "App.exe",
      "publisherName": "App.exe"
    }
  },

It will success build the App.exe.
But if the App.exe is large , the decompress will take long time. At this time, if user trying to double click for relaunch the App, it will throw file not find errors.
image

After some investigation, we found it caused by unpackDirName value in exectron-builder source code .

defines.UNPACK_DIR_NAME = portableOptions.unpackDirName || (await executeAppBuilder(["ksuid"]))

in NisiTarget.ts

It used a fixed location to decompress the application.
User trying to double click several times for relaunch the app, this time some folder may be removed during the decompress process. so the app will throw file not found error.

Can we use a random folder to decompress the application so that the file will not dropped in that case?

@stale
Copy link

stale bot commented Sep 27, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the backlog label Sep 27, 2019
@xalc
Copy link
Author

xalc commented Oct 1, 2019

But do someone have a work round to fix this?

@stale stale bot removed the backlog label Oct 1, 2019
@stale
Copy link

stale bot commented Nov 30, 2019

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Nov 30, 2019
@stale stale bot closed this as completed Dec 7, 2019
mmaietta added a commit to mmaietta/electron-builder that referenced this issue Apr 15, 2021
mmaietta added a commit that referenced this issue Jul 29, 2021
…unch (#6093)

* Allowing boolean flag to `unpackDirName` to utilize `$PLUGINSDIR` (unique to per-app-launch) when set explicitly to `true`. Implements #5764, #5382, #4105
@valueerrorx
Copy link

valueerrorx commented Oct 15, 2022

"portable":` {                
            "unpackDirName": true
},
"win": {
    "icon": "public/icons/icon.ico",
    "target": [
        {
            "target": "portable",
            "arch": [
                "x64"
            ]
        }
    ],
    "artifactName": "${productName}_${version}.${ext}"
}

just for information and easy use:
unpackdirname: true creates a new tmp folder on every unpack/start of the electron app and fixes that problem..

@valueerrorx
Copy link

this introduces another problem if your application need firewall exceptions. windows will treat the app as new app each start. that sucks.. sry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants