卸载电子应用程序后删除AppData
我想在卸载应用程序后删除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:$APPDATA
variable 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
$ appData取决于
setShellvarcontext
设置。在您的情况下,它已将其设置为所有
,这意味着您正在进行所有用户安装,并且您不应真正修改用户配置文件。如果您想忽略此建议,请确保您有v3.08并使用$ USERAPPDATA。
$AppData depends on the
SetShellVarContext
setting. In your case it has been set toall
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.