无法使用Inno Setup删除在“我的文档"中创建的文件夹 [英] Can't delete the folder created in My Documents with Inno Setup

查看:118
本文介绍了无法使用Inno Setup删除在“我的文档"中创建的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用此处描述的程序

I have tried to use the program described here Problems in deleting a Folder during the uninstalation with Inno Setup

发布答案后,但是由于某种未知的原因,我对代码部分没有执行任何操作.可能与Windows版本有关,还是32位或64位?

after the answers were posted but for some unknown reason to me that code part isn't doing anything. May be related to windows version or if it's on 32 or 64 bit?

这是我使用的代码:

procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
var
mres : integer;
begin
 case CurUninstallStep of
 usPostUninstall:
 begin
mres := MsgBox('Do you want to delete saved games?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
 if mres = IDYES then
   DelTree('ExpandConstant({userdocs}\SpellForce2)', True, True, True);
    end;  
  end;
end;

有什么想法对我有用吗?

Any idea that could be useful to me?

提前谢谢! :)

推荐答案

(您正在尝试删除一个名为'ExpandConstant({userdocs} \ SpellForce2)'的文件夹),只需删除"ExpandConstant调用的字符(它是对子例程的调用).

You are trying to delete a folder named 'ExpandConstant({userdocs}\SpellForce2)' (literally), just remove the ' character to the ExpandConstant call (it is a call to a sub-routine).

procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
var
  mres : integer;
begin
  case CurUninstallStep of
    usPostUninstall:
      begin
        mres := MsgBox('Do you want to delete saved games?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
        if mres = IDYES then
          DelTree(ExpandConstant('{userdocs}\SpellForce2'), True, True, True);
      end;  
  end;
end;

这篇关于无法使用Inno Setup删除在“我的文档"中创建的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆