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

Need a small change to handle apps with apostrophe in their name #750

Closed
ghost opened this issue Sep 14, 2016 · 6 comments · May be fixed by qcif/data-curator#563
Closed

Need a small change to handle apps with apostrophe in their name #750

ghost opened this issue Sep 14, 2016 · 6 comments · May be fixed by qcif/data-curator#563

Comments

@ghost
Copy link

ghost commented Sep 14, 2016

  • Version: 6.7.5
  • Target: Windows

I have an application with an apostrophe in its name. (I know, that's ridiculous, however sometimes you just gotta do what the customer wants.) This kills the NSIS builder because of a quirk in macro expansion. The apostrophe in the name closes an open apostrophe earlier in the line. There is a very simple fix.

In multiUser.nsh at line 69, stuff the uninstall filename into a register variable, then use that in the following WriteRegStr calls:

    # Write the uninstall keys for Windows
    StrCpy $R0 "$INSTDIR\${UNINSTALL_FILENAME}"
    ${if} $installMode == "all"
        WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" DisplayName "${UNINSTALL_DISPLAY_NAME}"
        WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" UninstallString '"$R0" /allusers'
    ${else}
        WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" DisplayName "${UNINSTALL_DISPLAY_NAME} (only current user)"
        WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" UninstallString '"$R0" /currentuser'
    ${endif}

With this one change, I'm able to build the installer just fine.

@develar
Copy link
Member

develar commented Sep 15, 2016

I think that ' should be just removed from file name (replaced to empy string).

@develar
Copy link
Member

develar commented Sep 15, 2016

' not replaced for, your solution committed.

develar added a commit to develar/electron-builder that referenced this issue Sep 15, 2016
@ghost
Copy link
Author

ghost commented Sep 16, 2016

Confirmed that this problem is no longer present in 6.7.7. Thank you!

@splrk
Copy link

splrk commented Dec 19, 2016

I am still experiencing this issue with version 7.26.0. I the think the better solution is to just use the package.json name for the installer and uninstaller file names. It's perfectly conceivable that the friendly name used to display to the users in the installer or desktop icons might have apostrophes in them. Why not just use the Node "name" attribute that already has restrictions we know are safe for file names and NSIS macros?

@develar
Copy link
Member

develar commented Dec 19, 2016

@splrk Please specify error details. And please try to use latest 10.8.1

@splrk
Copy link

splrk commented Dec 20, 2016

This only happens with the boring installer. I upgraded and got the same error:

Error output:
push expects 1 parameters, got 3.
Usage: Push string
Error in macro _StdUtils_ExecShlUser on macroline 1
!include: error in script: "boringInstaller.nsh" on line 13
Error in script "<stdin>" on line 21 -- aborting creation process

I did some digging and it turns out its an error with the StdUtils plugin. They use single quotes to surround string, so if your productName has a single quote in it StdUtils can't use it safely.

My current workaround is to manually redefine the PRODUCT_FILENAME in the script customization (build\installer.nsh):

!define /redef PRODUCT_FILENAME 'your_app_filename'

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.

2 participants