1
我想知道如何使用来自自定义向导页面的用户输入中的值。我有一个自定义页面,用户在其上键入ODBC连接数据。这是此部分的代码:Inno Setup:使用来自注册表部分中的自定义向导页面的数据
ServerDataPage := CreateInputQueryPage(AskAuthPage.ID,
'SQL Server Connection Data', '',
'Please insert data...');
ServerDataPage.Add('ODBC Name:', False);
ServerDataPage.Add('Server Name:', False);
ServerDataPage.Add('User:', False);
ServerDataPage.Add('Password:', False);
这是非常有用的,因为它应该。该页面随输入框和标题一起显示。
我也查了一个Inno Setup的例子。有这样一行:
ExamplePage.Values[0] := GetPreviousData('Name', ExpandConstant('{sysuserinfoname}'));
因此,我认为必须有一个“落后”的东西,如:
thisIsAVariable := ServerDataPage.Values[x]
我可以用这些变量来创建这样一个ODBC?
Root: HKCU; SubKey: Software\ODBC\ODBC.INI\ODBC Data Sources; ValueType: string; ValueName: Leist; ValueData: SQL Server; Flags: createvalueifdoesntexist uninsdeletevalue
Root: HKCU; SubKey: Software\ODBC\ODBC.INI\Leist; Flags: createvalueifdoesntexist uninsdeletevalue; ValueName: Driver; ValueType: string; ValueData: {sys}\SQLSRV32.dll
Root: HKCU; SubKey: Software\ODBC\ODBC.INI\Leist; Flags: createvalueifdoesntexist uninsdeletevalue; ValueName: Server; ValueType: string; ValueData: SERVERADRESS
Root: HKCU; SubKey: Software\ODBC\ODBC.INI\Leist; Flags: createvalueifdoesntexist uninsdeletevalue; ValueName: Database; ValueType: string; ValueData: DATABASE NAME
Root: HKCU; SubKey: Software\ODBC\ODBC.INI\Leist; Flags: createvalueifdoesntexist uninsdeletevalue; ValueName: LastUser; ValueType: string; ValueData: USER
Root: HKCU; SubKey: Software\ODBC\ODBC.INI\Leist; Flags: createvalueifdoesntexist uninsdeletevalue; ValueName: Password; ValueType: string; ValueData: PASSWORD
如果是这样,我必须把它放在脚本中?整个“自定义向导页”的东西在[Code]
部分。这些变量是否也可以在[Code]
部分之外使用?
问候
感谢您的答复。我测试了你的解决方案,它可以解决工作:(我也检查过你给我的链接,在“ServerDataPageValues ...”之前有一个“ExpandConstant”,但是这对我也有帮助。注册表项1:1,该变量也存在(否则自定义页面将工作在所有)。我必须编辑此功能的东西吗?对不起,我吸入如此糟糕的Inno。:D – aliimagnito
* wouldnt工作在所有 – aliimagnito
*“wouldnt work all at”* - 意思是什么?它是做什么的? –