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

include EULA license file in windows installer #781

Closed
fridgerator opened this issue Sep 26, 2016 · 6 comments
Closed

include EULA license file in windows installer #781

fridgerator opened this issue Sep 26, 2016 · 6 comments

Comments

@fridgerator
Copy link

  • Version: latest 7.9.0
  • Target: windows 10 x64

I am including an EULA license file in the NSIS installer.

I have edited package.json to include a custom nsis.include = resources/windows/license.nsh

My license.nsh script looks like this:

!include "MUI2.nsh"

!insertmacro MUI_PAGE_LICENSE "resources\license.txt"

The NSIS installer creation fails at common.nsh line 11 when setting Unicode true with:

Error: Can't change target architecture after data already got compressed or header already changed!
Error: Unable to set target charset (adequate stub not found?)

I can fix this temporarily by commenting out line 11 in common.nsh.

I'm not very familiar with NSIS, I wasn't sure it its possible to check the mentioned cases in the error message before setting the Unicode value or not. Or if this is even something that you all wanted to worry about.

@develar develar added the nsis label Sep 27, 2016
@develar
Copy link
Member

develar commented Sep 27, 2016

Please try to wrap your code into macro customHeader.

I am on vacation — you can expect fix in 3 days.

@artpol
Copy link

artpol commented Oct 18, 2016

Builder Version: 7.14.1
Target: Windows 10 x64

I'am trying to make EULA page in NSIS,

I make windows_license.nsh:

!macro customHeader
    !include "MUI2.nsh"
    !insertmacro MUI_PAGE_LICENSE "windows_license.txt"
!macroend

my developer package.json have this build section:

  "build": {
    "appId": "company.product",
    "productName":"Company Product",
    "mac": {
      "category": "public.app-category.business"
    },
    "win": {
      "target": ["nsis"],
      "msi": true
    },
    "nsis": {
      "oneClick": false,
      "perMashine": false,
      "include": "build/windows_license.nsh"
    }
  }

The NSIS installer creation fails with error:

Building NSIS installer
....
warning: !warning: MUI_PAGE_* inserted after MUI_LANGUAGE (macro:MUI_PAGE_INIT:3)
Error: warning treated as error

Please tell me what I'm doing wrong?

@develar
Copy link
Member

develar commented Oct 18, 2016

@artpol Issue is fixed, I will finish and push fix in the evening, please wait.

@artpol
Copy link

artpol commented Oct 18, 2016

Thanks a lot

@develar
Copy link
Member

develar commented Oct 18, 2016

Please try 7.14.2. nsis.license (path to file, not recommended, use convention) or just put license.rtf or license.txt to build resources (build directory).

Supported for all nsis variants.

@fridgerator
Copy link
Author

works great! thank you! 👍

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

No branches or pull requests

3 participants