zoukankan      html  css  js  c++  java
  • [Inno Setup] 卸载 重启之后 删除文件

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

    利用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, 'SoftwareMicrosoftWindowsCurrentVersionRunOnce', 'xxxUninstall', ExpandConstant('cmd.exe /c del {sys}driversxxx.sys'));
    
           end;end;
  • 相关阅读:
    gdbinit理解
    debug套路
    node 版本升级
    工作方式
    vscode 插件编写
    函数闭包与装饰器
    高阶函数与递归
    函数嵌套及作用域
    函数
    文件处理
  • 原文地址:https://www.cnblogs.com/liujx2019/p/11046330.html
Copyright © 2011-2022 走看看