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

The packaged application does not overwrite the previous version when installed and does not automatically uninstall the old version of the application #5573

Closed
Liting1 opened this issue Jan 22, 2021 · 21 comments
Labels

Comments

@Liting1
Copy link

Liting1 commented Jan 22, 2021

  • Version: "electron-builder": "^22.9.1",
  • Electron Version: "electron": "^11.1.1",
  • Electron Type (current, beta, nightly): current

"electron-updater": "^4.3.5",

  • Target:
    "target": [
    {
    "target": "nsis",
    "arch": [
    "x64"
    ]
    }
    ],

I tried to package the new version of the application, tried to install the application that covered the old version of the original, but the installation failed, the new version was not installed successfully

@wbhAvivahc
Copy link

i have same problem

@LodeLesage
Copy link

Experiencing the same issue building & installing on Windows 10 Pro with NSIS:
When trying to install a new version of the same app, the installation silently fails after getting to ~50% in the progress bar and just closes the installer.
Normally it should show a final page with a checkbox to run the app.
The result is that the old version is still installed and the files are still the same.

electron: 11.2.0
electron-builder: 22.9.1 (also tried 22.8.1 & 22.7.0)

electron-builder.json:

{
    "productName": "X",
    "appId": "com.x.x",
    "artifactName": "${productName}.${ext}",
    "copyright": "Copyright text",
    "directories": {
        "output": "release/"
    },
    "files": [
        "**/*",
        "!**/*.ts",
        "!*.code-workspace",
        "!LICENSE.md",
        "!package.json",
        "!package-lock.json",
        "!src/",
        "!e2e/",
        "!hooks/",
        "!angular.json",
        "!_config.yml",
        "!karma.conf.js",
        "!tsconfig.json",
        "!tslint.json"
    ],
    "fileAssociations": [{
        "ext": "x",
        "name": "X File",
        "role": "Viewer",
        "isPackage": false
    }],
    "win": {
        "icon": "build/icons/icon.ico",
        "artifactName": "${productName}.${ext}",
        "target": [
            "nsis"
        ]
    },
    "nsis": {
        "oneClick": false,
        "perMachine": true,
        "allowToChangeInstallationDirectory": true,
        "createDesktopShortcut": false,
        "uninstallDisplayName": "${productName}"
    }
}

The issue is that the install works fine the first time, but installing subsequent versions fails silently.
Manually uninstalling through apps & features and then installing again works fine as well.
The same issue also occurs when changing perMachine to false and using a per-user install instead.
In that case the installer will even detect that there is a previous installation and mention that at the bottom of the page when choosing the installation directory, saying it will upgrade/overwrite the existing installation.
Unfortunately it silently fails in the same way as previously described and no upgrade actually happens.
I also made sure to update the version in package.json between builds but that doesn't change anything.

I read through numerous issues, but none were exactly the same and none provided a working fix.

Any help would be much appreciated.
Thanks for all the hard work and the awesome project!

@ejwilburn
Copy link

ejwilburn commented Mar 11, 2021

We're seeing the same issue and it only happens when doing the guided install ("oneclick": false)

A work-around is to use an archive name with the version number included: "artifactName": "${productName} ${version}.${ext}" but doing it that way causes some anti-virus apps to warn that the executable is an unknown one since the name is never the same.

FYI, I've gotten logs from NSIS to see what's going on and the last entry in the install log is that it's executing the uninstaller and that the uninstall succeeded but it never actually executes the uninstaller. I've copied the command from the NSIS log and run it manually afterwards and the uninstall succeeds when run manually.

@ttomaszewski
Copy link

Also seeing this issue.

@mmaietta
Copy link
Collaborator

@ejwilburn would you be willing to share your NSIS logs here? I'm not familiar with this topic but I'd like to take a gander.

@ejwilburn
Copy link

@mmaietta here's the relevant portion of the log:

IfFileExists: file "C:\Users\user\AppData\Local\Programs\Product Name\Product Name.exe" exists, jumping 0
Call: 1789
SetFlag: 13=6
File: overwriteflag=1, allowskipfilesflag=0, name="C:\Users\user\AppData\Local\Temp\nss14E9.tmp\StdUtils.dll"
File: skipped: "C:\Users\user\AppData\Local\Temp\nss14E9.tmp\StdUtils.dll" (overwriteflag=1)
Call: 1789
SetFlag: 13=6
File: overwriteflag=1, allowskipfilesflag=0, name="C:\Users\user\AppData\Local\Temp\nss14E9.tmp\StdUtils.dll"
File: skipped: "C:\Users\user\AppData\Local\Temp\nss14E9.tmp\StdUtils.dll" (overwriteflag=1)
CreateDirectory: "C:\Users\user\AppData\Local\Temp\nss14E9.tmp" (0)
SetFlag: 2=0
CopyFiles "C:\Users\user\AppData\Local\Programs\Product Name\Uninstall Product Name.exe"->"C:\Users\user\AppData\Local\Temp\nss14E9.tmp\old-uninstaller.exe"
Exec: command=""C:\Users\user\AppData\Local\Temp\nss14E9.tmp\old-uninstaller.exe" /S /KEEP_APP_DATA /currentuser --keep-shortcuts --updated _?=C:\Users\user\AppData\Local\Programs\Product Name"
Exec: success (""C:\Users\user\AppData\Local\Temp\nss14E9.tmp\old-uninstaller.exe" /S /KEEP_APP_DATA /currentuser --keep-shortcuts --updated _?=C:\Users\user\AppData\Local\Programs\Product Name")

As of 22.10.5 the uninstall does actually run (it didn't in 22.9) but after completion you hear a windows error tone and the installer closes. Full log is attached.

install.log

@ravicious
Copy link

@ejwilburn How did you manage to get the NSIS logs? There's another issue asking how to do it with electron-builder (#5119), so I think this knowledge would be super helpful!

@ejwilburn
Copy link

@ravicious I responded with instructions in the issue you linked.

@stale
Copy link

stale bot commented Jun 2, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Jun 2, 2021
@stale stale bot closed this as completed Jun 11, 2021
@Liting1
Copy link
Author

Liting1 commented Aug 26, 2021

Has the problem been solved???

@Liting1
Copy link
Author

Liting1 commented Aug 26, 2021

Do you know what to do?

@sdelrue
Copy link

sdelrue commented Jun 2, 2022

still seeing this issue, progress bar silently exits halfway. The uninstall ran, but the new version is not installed (empty folder)
"electron": "^19.0.1",
"electron-builder": "^23.0.3"
"electron-updater": "^5.0.1",

edit
#6329 has a working fix, the artifactName & productName should not be the same

@mallamsripooja
Copy link

Facing the same issue, can someone please suggest a fix for this issue?

@iaIm14
Copy link

iaIm14 commented Oct 6, 2022

this problem is still unsolved ...

@adamcjm
Copy link

adamcjm commented Jan 29, 2023

I find a way to solve this problem:

  1. You can try to add a line code with the content CRCCheck off to bottom of the file node_modules/app-builder-lib/templates/nsis/common.nsh.

  2. And then rebuild and install the application to windows, and try to uninstall or update.

these two step fixed my problem.

@adamcjm
Copy link

adamcjm commented Jan 29, 2023

这个问题还是没有解决。。。

Pls see my comment.

@adamcjm
Copy link

adamcjm commented Jan 29, 2023

面对同样的问题,有人可以建议解决这个问题吗?

Pls see my comment.

@adamcjm
Copy link

adamcjm commented Jan 29, 2023

问题解决了吗???

My comment

@adamcjm
Copy link

adamcjm commented Jan 29, 2023

这个问题还是没有解决。。。

My comment

@adamcjm
Copy link

adamcjm commented Jan 29, 2023

你知道怎么办吗?

Bottom comment

@oxfordyang2016
Copy link

now i need to uninstall old installed software and reinstall the new version sotfware,it work,i wanna know why this happen

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

No branches or pull requests