INNO使用DefaultDirName中的注册表值进行设置

时间:2015-04-14 15:25:26

标签: inno-setup

我正在为其他应用程序编写附加组件。要安装附加组件,我需要读取加载项所针对的应用程序的注册表项。根据应用程序是安装在32位还是64位Windows上,我必须安装dll的文件夹是不同的。

我正在寻找这个问题的解决方案: 如何使用从注册表项获取的变量字符串到DefaultDirName?

我有这个:

#define DefaultRegistryKey64 'some regKey'
#define DefaultRegistryKey32 'Other RegKey'
[Setup]
AppName={#MyAppSetupname}
AppVersion={#MyAppVersion}
AppVerName={#MyAppsetupname} {#MyAppVersion}
AppCopyright=Company Name
AppPublisher=Company Name
AppPublisherURL=http://someurl
AppSupportURL=http://someur
VersionInfoVersion={#MyAppVersion}
DefaultDirName={code:getOSDefaultDirName}
DefaultGroupName={#MyAppSetupname}
DisableProgramGroupPage=yes
OutputDir=../StringSplitter Setup
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Code]
getOSDefaultDirName (Param: String): string;
 begin
 if Iswin64 then begin
  result := '{#DefaultDirName64}';
 end;
end;

0 个答案:

没有答案
相关问题