【发布时间】:2011-01-18 10:02:59
【问题描述】:
我首先说我是使用 Inno 设置的新手,如果这是一个愚蠢的问题,我很抱歉。 我正在尝试在卸载应用程序期间删除包含所有子文件夹和文件的文件夹。应用程序第一次运行时,将在“我的文档”中创建特定文件夹。为了删除它,我使用“Delltree”功能:
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var Ceva: integer;
begin
case CurUninstallStep of
usUninstall:
begin
MsgBox('CurUninstallStepChanged:' #13#13 'Uninstall is about to start.', mbInformation, MB_OK)
end;
usPostUninstall:
begin
Ceva := MsgBox('CurUninstallStepChanged:' #13#13 'Do you want to delete the folder ?.', mbConfirmation, MB_YESNO)
if Ceva = idYES then
DelTree('{userdocs}\myfolder', True, True, True);
end;
end;
由于某种原因,“{userdocs}”常量似乎不起作用。如果我将确切路径放入文件夹“DelTree('C:\Users\myuser\Documents\myfolder', True, True, True); ”,一切正常。
【问题讨论】: