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

Change installation directory when not using 'oneClick' with NSIS #596

Closed
gswebspace opened this issue Jul 18, 2016 · 15 comments · May be fixed by qcif/data-curator#563
Closed

Change installation directory when not using 'oneClick' with NSIS #596

gswebspace opened this issue Jul 18, 2016 · 15 comments · May be fixed by qcif/data-curator#563

Comments

@gswebspace
Copy link

electron-builder version

  • 5.12.1

Building for

  • windows nsis x64

Building on

  • linux x64(Ubuntu 16.04)

Assuming 'oneClick' is set to false for NSIS, and two package.json scheme is used with the development package.json having the build object as follows -

"build": {
    "appId": "com.somerandom.name",
    "productName": "RandomName",
    "asar":false,
    "win": {
      "target": "nsis",
      "title": "TitleValue",
      "version": "1.0.0",
      "authors": "User Name"
    },
    "nsis":{
      "oneClick": false
    }
  }

The Installation directory(tested with Windows 10) defaults to

C:\Users\username\AppData\Local\Programs\appname

How can the user be allowed to change the installation directory ?

@develar
Copy link
Member

develar commented Jul 18, 2016

If you want to install for all users, set perMachine to true. Or do you want to allow user to install to any location?

@develar develar added the nsis label Jul 18, 2016
@just-jeb
Copy link

+1 For this one. Allowing user to install to a custom location.

@develar
Copy link
Member

develar commented Jul 18, 2016

It is easy to do, will be implemented soon. But! Think twice — are you sure that your users will be more happy with boring installer instead of one-click (and without admin rights requirement)?

@gswebspace
Copy link
Author

The default path works fine with one-click installs, it makes sense.This issue only applies if one-click install is not required.

For such cases I want the user to be able to install to any location. If the user is an Administrator he should be allowed to choose the path suitable for his system configuration.

@just-jeb
Copy link

@develar
You're right, but I can foresee that my users might request such a level of control (where to install).

@thethreeonee
Copy link

+1
I think it's common sense for allowing users to choose where to install.

@domachine
Copy link

Is this possible to achieve using an include script?

@develar
Copy link
Member

develar commented Nov 15, 2016

@domachine Yes. But if you are able to make such change, it is better to send pull request.

@domachine
Copy link

@develar Ok, I'd happily send a pull-request. I'm just a little bit overwhelmed with this complex NSIS config. Currently figuring out the proper location to insert the !insertmacro MUI_PAGE_DIRECTORY statement. Would customInit be the right place?

@domachine
Copy link

OK, nope 😄 . The following include errors:

!macro customInit
  !insertmacro MUI_PAGE_DIRECTORY
!macroend

@develar
Copy link
Member

develar commented Nov 15, 2016

@domachine You need to write completely different NSIS script — script. Sorry for false info.

Or change https://github.com/electron-userland/electron-builder/blob/master/templates/nsis/boringInstaller.nsh and send PR (probably another files should be modified as well).

@domachine
Copy link

domachine commented Nov 15, 2016

@develar No problem. Do you have any hints on the template location where it might make sense to include such an option? Currently I'm hacking here

. As soon as I get somethin' working, I'll open a pull-request.

Edit: Ah, I see your updated answer. Thx for the information 👍

domachine added a commit to domachine/electron-builder that referenced this issue Nov 15, 2016
This is a quick n dirty change which works for me. I just wanted to keep these changes in this pull-request to elaborate and discuss on it. Regard this as a starting point to solve electron-userland#596. Still lacking are e.g. tests, of course.
develar added a commit to develar/electron-builder that referenced this issue Jan 5, 2017
@develar develar closed this as completed in 06b0103 Jan 5, 2017
@develar
Copy link
Member

develar commented Jan 5, 2017

Fixed in 11.1.0.

@gswebspace
Copy link
Author

Thanks to all for the awesome new feature !

@Pandakls
Copy link

Pandakls commented Sep 5, 2019

But now, we have a boring installer even for updates, am i wrong ?
How can I fix it in this idea :

    "nsisWeb": {
      "oneClick": "isUpdated",
      "perMachine": true,
      "allowToChangeInstallationDirectory": true
    },

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

Successfully merging a pull request may close this issue.

6 participants