使用 INNO setup 卸载时删除 dll 时出现的问题
我使用 GameuxInstallHelper.dll 在安装时使用 Games Explorer 注册我的游戏。
但由于某些原因,卸载后该 dll 仍保留在我的应用程序文件夹中,但仅限于 Win XP。在 Win 7 和 Vista 上,所有文件都会被删除。
使用的代码:
function CheckXPOs(): Boolean;
begin
if GetWindowsVersion shr 24 < 6 then Result:=TRUE
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
mres : integer;
begin
if CurUninstallStep = usUninstall then
begin
#ifdef AddToGameExplorer
if not CheckXPOs then
begin
RetrieveGUIDForApplication(ExpandConstant('{app}'+GE_resource), GUID);
RemoveFromGameExplorer(GUID);
RemoveTasks(GUID);
UnloadDll(ExpandConstant('{app}\GameuxInstallHelper.dll'));
end;
#endif
end;
case CurUninstallStep of
usPostUninstall:
begin
mres := MsgBox(ExpandConstant('{cm:removemsg}'), mbConfirmation, MB_YESNO)
if mres = IDYES then
DelTree(ExpandConstant('{app}'), True, True, True);
end;
end;
end;
知道为什么 dll 在 XP 操作系统上没有被删除吗?我该如何删除它? 我在卸载dll后尝试了DeleteFile函数,我还尝试创建另一个函数来搜索特定的dll,但没有任何帮助我解决问题。 并且该 dll 未使用,因为操作系统让我手动删除它。
I am using the GameuxInstallHelper.dll to register my game at installation with Games Explorer.
But for some the reason the dll remains in my application folder after uninstall, but only on Win XP. On Win 7 and Vista all files are deleted.
The code used:
function CheckXPOs(): Boolean;
begin
if GetWindowsVersion shr 24 < 6 then Result:=TRUE
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
mres : integer;
begin
if CurUninstallStep = usUninstall then
begin
#ifdef AddToGameExplorer
if not CheckXPOs then
begin
RetrieveGUIDForApplication(ExpandConstant('{app}'+GE_resource), GUID);
RemoveFromGameExplorer(GUID);
RemoveTasks(GUID);
UnloadDll(ExpandConstant('{app}\GameuxInstallHelper.dll'));
end;
#endif
end;
case CurUninstallStep of
usPostUninstall:
begin
mres := MsgBox(ExpandConstant('{cm:removemsg}'), mbConfirmation, MB_YESNO)
if mres = IDYES then
DelTree(ExpandConstant('{app}'), True, True, True);
end;
end;
end;
Any idea why the dll is not deleted on XP OS's and how can i delete it?
I've tried the DeleteFile function after unloading the dll, i've also tried to make another function to search for that specific dll, but nothing helped me solve the problem.
And the dll is not in use, because manually the OS is letting me delete it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在“not CheckXPOs”块之后卸载 dll。
另一种方法是在从 GameuxInstallHelper.dll 加载的所有函数的声明中添加“delayload”选项
You should unload dll after the "not CheckXPOs" block.
Another way is adding
"delayload"
option in declaration of all functions loaded from GameuxInstallHelper.dll