卸载电子应用程序后删除AppData

发布于 2025-01-22 15:19:47 字数 646 浏览 2 评论 0原文

我想在卸载应用程序后删除AppData。
deleteappdataonuninstall:true选项在我运行uninstaller.exe时很有用,但是当我再次安装应用程序时不起作用。

当我想安装V2版本以覆盖计算机中存在V1版本时,我想删除AppData并创建一个新版本。
我使用包括:installer.nsh来执行此操作。

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

但是问题是:
$ appdata nsis is c:\ programData,appdata路径我在electron App.getPath('userData')中c:\ user \ user \ user \ appdata \ roaming

我该怎么办删除appdata文件夹从app.getpath('userdata')

I want to remove the appData after my app was uninstalled.
The deleteAppDataOnUninstall: true option was useful when i run the uninstaller.exe,but not work when i install the app again.
When I want to install a version v2 to cover the version v1 existed in computer,i want to remove appData and create a new one.
I use the include: installer.nsh to do this.

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

But the question is:
$APPDATAvariable in nsis is C:\ProgramData,the appData path I got in Electron app.getPath('userData') is C:\Users\user\AppData\Roaming

What should I do to remove the appData folder got from app.getPath('userData')?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

归属感 2025-01-29 15:19:47

$ appData取决于setShellvarcontext设置。在您的情况下,它已将其设置为所有,这意味着您正在进行所有用户安装,并且您不应真正修改用户配置文件。

如果您想忽略此建议,请确保您有v3.08并使用$ USERAPPDATA。

$AppData depends on the SetShellVarContext setting. In your case it has been set to all and this means you are doing a all users install and you should not really modify a users profile.

If you want to ignore this advice then make sure you have v3.08 and use $USERAPPDATA.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文