Inno setup 将变量值从安装程序传送到卸载程序
Inno安装程序中的变量值是否转移到卸载程序?Inno setup 将变量值从安装程序传送到卸载程序,inno-setup,pascalscript,Inno Setup,Pascalscript,Inno安装程序中的变量值是否转移到卸载程序? 例如,我需要创建帐户,并在安装程序中检查用户名,在卸载时,使用安装程序中指定的名称访问帐户。值是否会结转,或者我应该将其存储在注册表之类的位置?不,它们不是。我个人会这样做(它使用在注册表中存储自定义值的机制): [Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}\My Program [Code] procedure RegisterPreviousData(Previou
例如,我需要创建帐户,并在安装程序中检查用户名,在卸载时,使用安装程序中指定的名称访问帐户。值是否会结转,或者我应该将其存储在注册表之类的位置?不,它们不是。我个人会这样做(它使用在注册表中存储自定义值的机制):
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
[Code]
procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
// this will store the value under the specified key; except uninstaller you
// can read the values stored this way in installer
SetPreviousData(PreviousDataKey, 'ValueName', 'ValueData');
end;
function InitializeUninstall: Boolean;
var
StoredValue: string;
begin
Result := True;
// read the value of the given key
StoredValue := GetPreviousData('ValueName', 'DefaultValueData');
MsgBox(StoredValue, mbInformation, MB_OK);
end;