Inno Setup 使用旧版本的安装目录(覆盖)安装和强制使用指定安装目录安装

 

inno setup 中的 UsePreviousAppDir 为是否使用原来的安装目录,默认的为使用原来的安装目录

yes时使用原来的安装目录

no时使用强制指定的安装目录

官方文档:https://jrsoftware.org/ishelp/

官方文档是这样写的:

[Setup]: UsePreviousAppDir

Valid values:

yes or no

Default value:

yes

Description:

When this directive is yes, the default, at startup Setup will look in the registry to see if the same application is already installed, and if so, it will use the directory of the previous installation as the default directory presented to the user in the wizard.

Note that Setup cannot re-use settings from a previous installation that had Uninstallable set to no, since the registry entries it looks for are not created when Uninstallable is no.

 

 

inno setup向导中默认是没有给UsePreviousAppDir赋值的,并且UsePreviousAppDir使用了缺省值yes,

如果需要使用强制指定的安装目录,可以在[Setup]后添加一行面:UsePreviousAppDir=no即

[Setup]

UsePreviousAppDir=no

当然还可以写函数使用函数返回值来给UsePreviousAppDir赋值

参考其他博客:

https://www.it1352.com/37811.html

http://newbt.net/ms/vdisk/show_bbs.php?id=AACA9C7819D2754013845B69C792650B&pid=160&last=1