只有在我对已安装的应用程序进行更新时,我才需要忽略一些文件(" .sdf"和" .config")
我以递归方式获取文件:
[Files]
Source: "..\..\bin\Release\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\bin\Release\*"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-full; Excludes: "*.key, *.udb, *.~db, *.crt"
存在某种方式?
提前致谢。
回答1
使用 onlyifdestfileexists 和 onlyifdoesntexist :
如果文件不存在( onlyifdoesntexist ),请在首次安装时复制所有内容。
如果文件存在( onlyifdestfileexists ),请添加排除您不想更新的扩展程序。
Source: "..\..\bin\Release\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion onlyifdoesntexist recursesubdirs createallsubdirs; Permissions: everyone-full; Excludes: "*.key, *.udb, *.~db, *.crt"
Source: "..\..\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion onlyifdestfileexists recursesubdirs createallsubdirs; Excludes: "*.key, *.udb, *.~db, *.crt, *.sdf, *.config"
答案2(尚未经过全面测试)
使用函数验证应用程序文件夹是否存在。
[Files]
Source: "..\..\bin\Release\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\bin\Release\*"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-full; Excludes: "*.key, *.udb, *.~db, *.crt"; Check: not IsInstalled
Source: "..\..\bin\Release\*"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-full; Excludes: "*.key, *.udb, *.~db, *.crt, *.sdf, *.config"; Check: IsInstalled
[code]
function IsInstalled: Boolean;
begin
if DirExists(ExpandConstant('{app}\')) then
begin
Result := True;
end else
Result := False;
end;
答案 0 :(得分:1)
在条目中添加Check参数,并确保在更新案例中check函数返回false。以下是可以参考的例子。
[文件] 资料来源:“MYPROG.EXE”; DestDir:“{app}”;检查:MyProgCheck
http://www.jrsoftware.org/ishelp/index.php?topic=scriptcheck