虎版,你好。
我现在有一个小需求不知道如何修改。
就是我下面有一个软件补丁包的代码,默认是自动查询已安装的软件路劲,然后安装。
(我想加入一种情况,就是查询不到已安装软件安装的时候,它会安装到C盘program下面,这个默认地方怎么设置,我想不让他装到那儿。)
代码在下面:
AppId={{7CF7983F-499E-47E9-898B-00FC5C9FE056}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={code:GetPath}
DisableDirPage=yes
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
;OutputDir=H:\D盘暂存\00 work\11 IAP V1.0\10 软件\100 安装包制作\补丁包制作\IAP_SP_V1.1.8.0.24补丁
OutputBaseFilename=IAPcom V2.0.0.3
Compression=lzma
SolidCompression=yes
;新增属性
WindowVisible=yes
VersionInfoVersion=2.0.0.18
VersionInfoCompany=中海创集团
VersionInfoDescription=中海创集团
VersionInfoCopyright=中海创集团
;LicenseFile=License.txt
WizardImageFile=E:\Inno Setup 5\WizModernImage.bmp
WizardSmallImageFile=E:\Inno Setup 5\WizModernSmallImage.bmp
[Languages]
Name: "chinesetraditional"; MessagesFile: "compiler:Languages\Chinese Traditional.isl"
Name: "chinesesimp"; MessagesFile: "compiler:Languages\ChineseSimp.isl"
Name: "english"; MessagesFile: "compiler:Languages\English.isl"
[Files]
Source: "C:\Users\Administrator\Desktop\IAPcom V2.0.0.3\*"; DestDir: "{app}\IAPcom"; Flags: ignoreversion
; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”
[code]
function GetPath(Param: String): String;
var
strPath: String;
begin
strPath := ExpandConstant('{pf}\IAP');
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7CF7983F-499E-47E9-898B-00FC5C9FE056}_is1', 'InstallLocation', strPath) then
begin
strPath := ExtractFilePath(strPath);
end;
Result := strPath;
end;