简体   繁体   English

NSIS并在卸载时从XML读取

[英]NSIS and reading from XML on uninstall

I create a Windows installation package of my Java (Swing) application with NSIS tool. 我用NSIS工具创建了我的Java(Swing)应用程序的Windows安装包。

After installation when a user starts an application it creates a temporary "work" folder in the " user.dir " directory using a user-customized name as the directory name. 在用户启动应用程序安装后,它使用用户自定义名称作为目录名称在“ user.dir ”目录中创建一个临时“工作”文件夹。 The full path of this folder is saved to an XML file in " user.dir"/Corp/configuration.xml file. 此文件夹的完整路径将保存到“ user.dir”/Corp/configuration.xml文件中的XML文件中。

This folder might contain gigabytes of data (depending on user activity). 此文件夹可能包含千兆字节的数据(取决于用户活动)。

This is important to delete this directory if a user decides to uninstall the application using NSIS standard "uninstall". 如果用户决定使用NSIS标准“卸载”卸载应用程序,则删除此目录非常重要。

The question I would like to ask respected SO people is: 我想问的受人尊敬的问题是:

HOW CAN I READ AN XML FILE IN NSIS FROM "user.dir" FOLDER TO GET A FOLDER PATH AND DELETE IT? 我如何从“user.dir”文件夹中读取NSIS中的XML文件以获取文件路径并删除它?

This is an extract from my script file to do "uninstall" procedure: 这是我的脚本文件中的一个摘录,用于执行“卸载”过程:

Section "Uninstall"

  ;ADD YOUR OWN FILES HERE...

  Delete "$INSTDIR\Uninstall.exe"

  RMDir /r "$INSTDIR"

  !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder

  Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
  Delete "$SMPROGRAMS\$StartMenuFolder\Corp MyApp.lnk"

  RMDir "$SMPROGRAMS\$StartMenuFolder"

  DeleteRegKey /ifempty HKCU "Software\Corp\MyApp"

SectionEnd

Thank you for your help! 谢谢您的帮助!

Cheers 干杯

您可以使用多个XML插件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM