Electron-builder: Updater: NSIS always creates shortcuts on the desktop even if users delete it (Windows)

Created on 1 Jan 2017  Â·  2Comments  Â·  Source: electron-userland/electron-builder

  • electron-builder Version: 10.15.1
  • electron-auto-updater Version: 0.8.6
  • Target: win32 x64
  • Build command:
    npm run dist2 --python="C:/Python27/python.exe"

  • Console output:

Rebuilding native production dependencies for win32:x64
Packaging for win32 x64 using electron 1.4.13 to dist\win-unpacked
Packaging NSIS installer for arch x64
Building NSIS installer
Creating Github Publisher - owner: Zamiell, project: isaac-racing-client, version: 0.0.49
Release with tag v0.0.49 doesn't exist, creating one
Uploading RacingPlus-Setup-0.0.49.exe [====================] 100% 0.0s
Released version 0.0.49 successfully.
  • Main package.json:
{
{
  "name": "RacingPlus",
  "description": "A racing mod for The Binding of Isaac: Afterbirth+.",
  "scripts": {
    "start": "electron ./app",
    "postinstall": "install-app-deps",
    "pack": "build --dir",
    "dist": "build",
    "dist2": "build --publish always"
  },
  "build": {
    "appId": "org.electron.isaacRacingClient",
    "win": {},
    "publish": {
      "provider": "github"
    }
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/Zamiell/isaac-racing-client.git"
  },
  "license": "GPL-3.0",
  "bugs": {
    "url": "https://github.com/Zamiell/isaac-racing-client/issues"
  },
  "homepage": "https://isaacracing.net",
  "devDependencies": {
    "electron": "^1.4.13",
    "electron-builder": "^10.15.1"
  }
}
  • App package.json (in app subdirectory):
{
  "name": "RacingPlus",
  "productName": "Racing+",
  "main": "./main.js",
  "version": "0.0.49",
  "description": "A racing mod for The Binding of Isaac: Afterbirth+.",
  "author": "Racing+",
  "license": "GPL-3.0",
  "dependencies": {
    "electron-auto-updater": "^0.8.6",
    "electron-is-dev": "^0.1.2",
    "electron-log": "^1.3.0",
    "fs-extra": "^1.0.0",
    "keytar": "^3.0.2",
    "linkifyjs": "^2.1.3",
    "raven": "^1.1.1",
    "tail": "^1.2.1",
    "teeny-conf": "^1.1.0",
    "touch": "^1.0.0",
    "tracer": "^0.8.7"
  }
}
  • Node version: v6.9.1
  • NPM version: 3.10.8
  • OS: Windows 7 x64 Professional

The problem

  • By default, the NSIS installer creates a shortcut on the desktop after initial installation. This is a good thing, as it seems like a good default behavior for my users.
  • Some users might not want the desktop shortcut. But that is fine - they can just delete it themselves manually after installation is completed.
  • However, after an automatic update, the desktop shortcut is recreated by the NSIS installer. So, the user has to keep deleting the desktop shortcut OVER and OVER every single time the application is updated.

Is there a way to make electron-builder create the desktop shortcut on installation, but not on automatic update?

backlog feature help wanted nsis

Most helpful comment

I guess the solution here would be to add support for a customFinish macro to the NSIS installer (see the currently supported macros)

You could then implement a macro for your installer which does the following:

All 2 comments

I guess the solution here would be to add support for a customFinish macro to the NSIS installer (see the currently supported macros)

You could then implement a macro for your installer which does the following:

It is not easy (as generic solution) to implement because new installer may be completely different (new locations for shortcuts and so on). I cannot promise that I will implement it in a short term. PR welcome.

As @badams said, currently there is a workaround — you customize installer.

So, moved to backlog to keep issue list clear.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antonycourtney picture antonycourtney  Â·  3Comments

alexstrat picture alexstrat  Â·  3Comments

noahprince22 picture noahprince22  Â·  3Comments

AidanNichol picture AidanNichol  Â·  3Comments

philcockfield picture philcockfield  Â·  3Comments