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

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

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

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

Source: programsShellExtensionExample.dll; DestDir: {app}; Flags: restartreplace ignoreversion uninsrestartdelete regserver 64bit; AfterInstall: RestartExplorer
procedure RestartExplorer();
var
  Ret : Integer;
begin
  Exec(ExpandConstant('{sys}') + '	askkill.exe',
         '/f /im explorer.exe', ExpandConstant('{win}') ,SW_HIDE, ewWaitUntilTerminated, Ret)
  Exec(ExpandConstant('{win}') + 'explorer.exe',
         '', ExpandConstant('{win}') ,SW_HIDE, ewNoWait, Ret)
end;
原文地址:https://www.cnblogs.com/liujx2019/p/14325463.html