当您两次列出同一文件时,在Inno Setup中会发生什么? [英] What happens in Inno Setup when you list the same file twice?

查看:67
本文介绍了当您两次列出同一文件时,在Inno Setup中会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您设置一个Inno Setup .iss文件以将同一文件两次安装到同一位置时,会发生什么情况? Inno Setup会实现您的工作,只包含并安装一次文件,还是将文件收集到安装中多次,并为每个实例覆盖它?

What happens when you setup an Inno Setup .iss file to install the same file to the same location twice? Does Inno Setup realize what you are doing, and just include and install the file once, or does it collect the file into the install multiple times, and overwrite it for each instance?

推荐答案

Inno Setup非常聪明,可以识别相同的源文件,并且仅将其包含在安装程序中一次.重复的源文件是有正当理由的;您可能希望将同一文件安装到目标系统上的不同位置.请注意,Inno Setup 不会在不同的源位置合并相同的文件.

Inno Setup is smart enough to identify an identical source file and will include it only once to the installer. There's a legitimate reason for having duplicate source files; you may want to install the same file to different locations on the target system. Note that Inno Setup won't merge same files in different source locations.

Inno Setup无法识别的是相同的目标位置(我想不出拥有相同目标位置的正当理由).因此它将安装文件两次.显然,由于将它两次安装到同一位置,因此第二次安装实际上不会发生(带有具有默认标志的可执行文件,因为版本匹配)或几乎没有引起注意(因为您覆盖了相同的 data 文件).

What Inno Setup won't identify is an identical target location (I cannot think of a legitimate reason for having identical target location). So it will install the file twice. Obviously as it installs it twice to an identical location, the second installation actually does not happen (with executable files with the default flags, as the version match) or is barely noticeable (as you overwrite an identical data file).

[Files]
Source: "MyProg.exe"; DestDir: "{app}"
Source: "MyProg.exe"; DestDir: "{app}"
Source: "Requirements.txt"; DestDir: "{app}"
Source: "Requirements.txt"; DestDir: "{app}"

2015-04-01 17:33:06.529   -- File entry --
2015-04-01 17:33:06.529   Dest filename: C:\Program Files (x86)\My Program\MyProg.exe
2015-04-01 17:33:06.529   Time stamp of our file: 2013-08-27 02:00:00.000
2015-04-01 17:33:06.529   Installing the file.
2015-04-01 17:33:06.542   Successfully installed the file.
2015-04-01 17:33:06.543   -- File entry --
2015-04-01 17:33:06.543   Dest filename: C:\Program Files (x86)\My Program\MyProg.exe
2015-04-01 17:33:06.543   Time stamp of our file: 2013-08-27 02:00:00.000
2015-04-01 17:33:06.543   Dest file exists.
2015-04-01 17:33:06.543   Time stamp of existing file: 2013-08-27 02:00:00.000
2015-04-01 17:33:06.543   Version of our file: 1.5.0.0
2015-04-01 17:33:06.545   Version of existing file: 1.5.0.0
2015-04-01 17:33:06.545   Same version. Skipping.
2015-04-01 17:33:06.545   -- File entry --
2015-04-01 17:33:06.545   Dest filename: C:\Program Files (x86)\My Program\Requirements.txt
2015-04-01 17:33:06.546   Time stamp of our file: 2015-04-01 17:29:10.000
2015-04-01 17:33:06.546   Installing the file.
2015-04-01 17:33:06.547   Successfully installed the file.
2015-04-01 17:33:06.547   -- File entry --
2015-04-01 17:33:06.547   Dest filename: C:\Program Files (x86)\My Program\Requirements.txt
2015-04-01 17:33:06.548   Time stamp of our file: 2015-04-01 17:29:10.000
2015-04-01 17:33:06.548   Dest file exists.
2015-04-01 17:33:06.548   Time stamp of existing file: 2015-04-01 17:29:10.000
2015-04-01 17:33:06.548   Version of our file: (none)
2015-04-01 17:33:06.549   Version of existing file: (none)
2015-04-01 17:33:06.549   Installing the file.
2015-04-01 17:33:06.550   Successfully installed the file.

这篇关于当您两次列出同一文件时,在Inno Setup中会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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