Install only if external file exists

故事扮演 提交于 2020-12-25 18:23:12

问题


I would like to instruct Inno Setup to install a certain external file only if does exist.

Like so:

Source: "d:\sources\SomeDLL.dll"; DestDir: {app}; \
    Flags: external regserver uninsneveruninstall ignoreversion

However, I did not find a flag that would instruct Inno Setup to skip this line / file if d:\sources\SomeDLL.dll does not exist.

Is this possible?

Thank you!


回答1:


Use the skipifsourcedoesntexist flag:

This flag instructs the compiler -- or Setup, if the external flag is also used -- to silently skip over the entry if the source file does not exist, instead of displaying an error message.




回答2:


Try this flag:

onlyifdestfileexists

Only install the file if a file of the same name already exists on the user's system. This flag may be useful if your installation is a patch to an existing installation, and you don't want files to be installed that the user didn't already have.

http://www.jrsoftware.org/ishelp/index.php?topic=filessection



来源:https://stackoverflow.com/questions/37163013/install-only-if-external-file-exists

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!