question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Auto updater has error with NSIS target: Windows 7 or above is required.

See original GitHub issue
  • Version:
    • electron-builder : ~22.4.1
    • electron-updater : ~4.2.5
  • Target: NSIS

I here this bug is fixed, but not for me in NSIS. Auto updater is using ‘electron-updater’, it runs good in other windows version except windows 7.

In my case, when ready to install new version(after downloaded), main process will send a message to renderer progress to notify user, after user had make sure to quit and install, i call quitAndInstall(). Then error occurs in windows 7: ‘Windows 7 or above is required’;

I had change parameter perMachine to false (true failed either), and tested both choices while installing (current user or all users), both failed.

Here is my configuration:

win: {
    icon: 'static/icons/icon.ico',
    requestedExecutionLevel: 'asInvoker',
    signingHashAlgorithms: [ 'sha256', 'sha1' ],
    certificateFile: 'scripts/cer/flicker_windows.pfx',
    publisherName: 'xxx',
    verifyUpdateCodeSignature: false,
    artifactName: 'xxx',
  },
  nsis: {
    include: 'scripts/nsis/installer.nsh',
    shortcutName: 'xxx',
    uninstallDisplayName: 'xxx',
    allowToChangeInstallationDirectory: true,
    createStartMenuShortcut: true,
    createDesktopShortcut: true,
    oneClick: false,
    perMachine: false,
  },

scripts/nsis/installer.nsh

!include WinVer.nsh

!macro customInstall
${If} ${AtMostWin7}
  WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\${PRODUCT_NAME}.exe" "VISTARTM"
${EndIf}
!macroend

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

2reactions
cooderzengcommented, Apr 20, 2020

I had the same problem at windows7 when I set the compatibility to Vista.

But if I not set ,it will show a black screen. 🥺🥺

Version: electron-builder : 21.2.0 electron-updater : 4.2.0

0reactions
ffdfgdfgcommented, Aug 18, 2020

Need a disable-gpu flag to force CPU render, so I add a detection like this:

if (os.release().startsWith('6.1')) {
  app.disableHardwareAcceleration()
}

Don’t need to set compatibility anymore, so auto updater works. electron-updater: 4.3.4 electron: 9.2.0 electron-builder: 22.8.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

NSIS all users installation auto-update · Issue #2363 - GitHub
I think that this problem is caused by the fact that silent installer is not aware of what permission it has when it...
Read more >
electron updater notify for new release but do not update or ...
15.1 locally I updated to v14.16.0 now it works! Another issue using other versions update and downgrade it was downloading it but failed...
Read more >
electron-builder-squirrel-windows | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
49861 – NSIS: remove the directory after the NSIS is finished
We have discussed this problem when we introduced the nsis installer. And it is true. For the Windows Installer the installation set is...
Read more >
CPack NSIS Generator — CMake 3.25.1 Documentation
Changed in version 3.22: The NSIS generator requires NSIS 3.03 or newer. ... the graphical installers built on Windows Nullsoft Scriptable Install System....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found