[Inno Setup] 安装与卸载 Shell Extension DLL

可以全新安装,升级,卸载。

DLL 文件在卸载,重启Windows后删除。所以在卸载之后不会重启explorer.exe.这么做是因为安装包本身就需要重启电脑。

副作用:升级结束之后,会弹出文件浏览器的窗口。

 

Source: programs\ShellExtensionExample.dll; DestDir: {app}; Flags: restartreplace ignoreversion uninsrestartdelete regserver 64bit; AfterInstall: RestartExplorer

 

procedure RestartExplorer();
var
  Ret : Integer;
begin
  Exec(ExpandConstant('{sys}') + '\taskkill.exe',
         '/f /im explorer.exe', ExpandConstant('{win}') ,SW_HIDE, ewWaitUntilTerminated, Ret)
  Exec(ExpandConstant('{win}') + '\explorer.exe',
         '', ExpandConstant('{win}') ,SW_HIDE, ewNoWait, Ret)
end;

 

posted on 2021-01-25 15:29  liujx2019  阅读(559)  评论(0编辑  收藏  举报

导航