mik*_*ike 4 registry inno-setup pascalscript
这就是我想要弄清楚的,在 Inno Setup 中,我希望安装程序能够获得
我想将这两个用作变量以将其保存在注册表中
只需结合这些问题的答案:
他们向您展示了如何使用CreateInputQueryPage函数和脚本常量来获得这样的代码:
[Registry]
Root: HKCU; Subkey: "Software\My Company\My Program"; \
ValueType: string; ValueName: "UserName"; ValueData: "{code:GetUserName}"
Root: HKCU; Subkey: "Software\My Company\My Program"; \
ValueType: string; ValueName: "UserBirthday"; ValueData: "{code:GetUserBirthday}"
Run Code Online (Sandbox Code Playgroud)
[Code]
var
UserInputsPage: TInputQueryWizardPage;
function GetUserName(Param: string): string;
begin
Result := UserInputsPage.Values[0];
end;
function GetUserBirthday(Param: string): string;
begin
Result := UserInputsPage.Values[1];
end;
procedure InitializeWizard;
begin
{ Create the page }
UserInputsPage :=
CreateInputQueryPage(wpWelcome,
'User information', 'User name and birthday',
'Please specify the following information, then click Next.');
UserInputsPage.Add('Name:', False);
UserInputsPage.Add('Birthday:', False);
end;
Run Code Online (Sandbox Code Playgroud)
这将创建一个注册表项,如:
[HKEY_CURRENT_USER\SOFTWARE\My Company\My Program]
"UserName"="John Doe"
"UserBirthday"="1975-05-02"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1270 次 |
| 最近记录: |