Inno setup 卸载所有内容,甚至“卸载”;应用程序新创建的文件";使用inno设置

Inno setup 卸载所有内容,甚至“卸载”;应用程序新创建的文件";使用inno设置,inno-setup,Inno Setup,我使用INNO安装程序为我的应用程序“Demo”(.Net应用程序)创建安装程序。在不启动应用程序的情况下,安装和卸载工作正常 如果应用程序启动,卸载并不是清除所有内容。因为我的应用程序会在启动期间更新现有文件并创建一些文件 那么,我们如何在发射后清理所有东西呢 我的脚本代码可用@ 提前感谢您可以通过两种方式实现 1st简单,但不会通知用户删除新文件/更改文件/附加文件: [UninstallDelete] Type: filesandordirs; Name: "{app}" [Code]

我使用INNO安装程序为我的应用程序“Demo”(.Net应用程序)创建安装程序。在不启动应用程序的情况下,安装和卸载工作正常

如果应用程序启动,卸载并不是清除所有内容。因为我的应用程序会在启动期间更新现有文件并创建一些文件

那么,我们如何在发射后清理所有东西呢

我的脚本代码可用@


提前感谢

您可以通过两种方式实现

1st简单,但不会通知用户删除新文件/更改文件/附加文件:

[UninstallDelete]
Type: filesandordirs; Name: "{app}"
[Code]

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then begin
    if MsgBox('Do you want to delete all data files?', mbConfirmation,
        MB_YESNO) = IDYES 
    then begin
      DelTree(ExpandConstant('{app}'), False, True, True);
      //first False makes that the main Directory will not be deleted by function
      //but it will be by the end of Uninstallation
    end;
  end;
end;
{app}
扩展为应用程序的完整路径。 默认情况下(基于您的代码片段),它将等于
DefaultDirName={pf}{{MyAppName}{{MyAppName}

MsgBox:

[UninstallDelete]
Type: filesandordirs; Name: "{app}"
[Code]

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then begin
    if MsgBox('Do you want to delete all data files?', mbConfirmation,
        MB_YESNO) = IDYES 
    then begin
      DelTree(ExpandConstant('{app}'), False, True, True);
      //first False makes that the main Directory will not be deleted by function
      //but it will be by the end of Uninstallation
    end;
  end;
end;

我试着回答。但未解决您可能会指向要删除的特定文件或通用应用文件夹。感谢回复@RobeN。但是我已经提到了
[UninstallDelete]类型:filesanddires;名称:“{app}\{#MyAppName}”但不工作。由应用程序在
{#MyAppName}
Hmm中创建的文件。。。您的应用程序文件夹是
{App}
等于
DefaultDirName={pf}{MyAppName}{MyAppName}
。因此,您不必添加额外的
{MyAppName}
。尝试
[UninstallDelete]类型:filesanddires;名称:“{app}\*”
好的,我会尝试更新