-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Electron-builder's installer "safe directory" issue #6885
Comments
Hey, maybe we can submit a pull request about it, do you need help making one? I'm unsure what exactly we need to do but maybe that will help: You can also specify # Windows Installer configuration - https://www.electron.build/configuration/nsis
nsis:
artifactName: "${productName}-${version}-${arch}-win-installer.${ext}"
oneClick: false
perMachine: true
allowToChangeInstallationDirectory: true it works for dmg, nsis, win, linux, mac and on the root, idk what it does but yeah I have it configured for each one using something like so: appId: 'com.example.app'
artifactName: 'ExampleSetup.${ext}' # copied that from you
# Linux configuration - https://www.electron.build/configuration/linux
linux:
artifactName: "marktext-${arch}.${ext}"
# Windows configuration - https://www.electron.build/configuration/win
win:
artifactName: "${productName}-${version}-${arch}-win-portable.${ext}"
# Windows Installer configuration - https://www.electron.build/configuration/nsis
nsis:
artifactName: "${productName}-${version}-${arch}-win-installer.${ext}"
# Mac OS configuration - https://www.electron.build/configuration/mac
mac:
artifactName: "${productName}-${version}-${arch}-macos-portable.${ext}"
# Mac OS Installer configuration - https://www.electron.build/configuration/dmg
dmg:
artifactName: "${productName}-${version}-${arch}-macos-installer.${ext}" idk good luck I'm just throwing wood into the fire |
Hey, I just found something during my research that might help, been looking for this issue, here we go: Edit: So that's basically needs to be inside |
During the first program install when the selected directory doesn't exist it's not enforced that path contains application name as sub-folder. On subsequent installs e.g. on update, that condition is enforces though, which creates a new installation in sub-folder. This tries to address electron-userland#6885
We’ve chosen to use electron-builder to create the installer because it’s easy to integrate. However, there is a small, mostly-inconsequential buglet concerning how it chooses its install directory.
By default, it’ll use the productName as its leaf install directory. So you get something like %PROGRAMFILES%/${productName}.
This is fine, unless you want to install somewhere else, like %SOMEPLACE%/foo. If that directory doesn’t exist yet, everything works fine. However, on the second install, it’ll install into %SOMEPLACE%/foo/${productName}. This is because electron-builder has an empty-directory check, which will append productName to the requested directory if the latter isn’t empty.
It shouldn’t just do an ‘empty’ check, but also see if this dir is the current install dir.
The reason I stumbled on this is that I’d prefer to have the directory be named “example-project”. This can be done by using productName="example-project", but then that also shows up in the text of the installer. I’d prefer that to be “Example Project”, but then the directories get weird.
For w use “example-project”, but we would like to know how this can be resolved.
Details:
Windows
package.json
electron-build.yml
scripts/installer.nsh
The text was updated successfully, but these errors were encountered: