WOG
WOG

Reputation: 1

Cordova electrong app ignore "build": { "nsis": { "include": "uninstaller.nsh" } }, when uninstall app

I have cordova electron app on the package.json I have added build section

    "build": {
      "nsis": {
        "include": "uninstaller.nsh"
      }
    },

in file uninstaller.nsh I have this code

!macro customUnInstall
  RMDir /r "$APPDATA\${APP_PACKAGE_NAME}"
!macroend

When I run command cordova build electron --release I see in builded file builder-effective-config.yaml this builde commands

directories:
  output: D:\Projects\myapp\platforms\electron\build
  buildResources: D:\Projects\myapp\platforms\electron\build-res
  app: D:\Projects\myapp\platforms\electron\www
nsis:
  include: uninstaller.nsh
  oneClick: false
  allowToChangeInstallationDirectory: true
appId: my.app.id
productName: MY APP
electronVersion: 29.4.6
electronDownload:
  version: 29.4.6
win:
  target:
    - target: msi
      arch:
        - x64
  icon: installer.png
files: []

But when I install my app and the try uninstall this not delete appData folder please see this screenshot

Why this uninstall script not works?

Upvotes: 0

Views: 31

Answers (0)

Related Questions