首页 > 其他 > 详细

[Inno Setup] 卸载 重启之后 删除文件

时间:2019-06-18 17:25:54      阅读:199      评论:0      收藏:0      [点我收藏+]

某些系统文件,例如驱动,不重启无法删除。

利用windows注册表里的 RunOnce。注意必须在HKLM下,否则可能权限不够。

不能直接填cmd命令,要以cmd的参数形式填写。

procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
var
     mres : integer;
begin
    case CurUninstallStep of                   
    usPostUninstall:
        begin
          mres := MsgBox(Do you want to remove the settings of xxx?, mbConfirmation, MB_YESNO or MB_DEFBUTTON2);
          if mres = IDYES then
            DelTree(ExpandConstant({commonappdata}\xxxFiles), True, True, True);

          RegWriteStringValue(HKLM, Software\Microsoft\Windows\CurrentVersion\RunOnce, xxxUninstall, ExpandConstant(cmd.exe /c del {sys}\drivers\xxx.sys));

       end;end;

 

[Inno Setup] 卸载 重启之后 删除文件

原文:https://www.cnblogs.com/liujx2019/p/11046330.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!