论坛风格切换切换到宽版
  • 1864阅读
  • 0回复

求助虎版~,补丁包的名称能否自动识别? [复制链接]

上一主题 下一主题
离线373723699
 

发帖
38
金钱
380
威望
38
只看楼主 倒序阅读 0 发表于: 2016-01-08
目前我的这个补丁包,原包装包装的名字如123 ,我后面手动将123重命名为1234,然后运行我的补丁包,居然会在同一目录下生成一个123的文件夹,请问怎么才能让补丁包自动安装到1234的这个文件夹中??


[Setup]
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
OutputBaseFilename=IAP_SP_V2.0.0.18.5
Compression=lzma
SolidCompression=yes
;新增属性
WindowVisible=yes
VersionInfoVersion=1.0
;LicenseFile=License.txt
WizardImageFile=D:\Inno Setup 5\WizModernImage.bmp
WizardSmallImageFile=D:\Inno Setup 5\WizModernSmallImage.bmp
Uninstallable=no

[Languages]
Name: "chinesetraditional"; MessagesFile: "compiler:Languages\Chinese Traditional.isl"
Name: "chinesesimp"; MessagesFile: "compiler:Languages\ChineseSimp.isl"
Name: "english"; MessagesFile: "compiler:Languages\English.isl"

[InstallDelete]
Type: files; Name: "{app}\IAPview\ConfigFile\Compile\*"
Type: files; Name: "{app}\IAPview\ConfigFile\ElementData\*"
Type: files; Name: "{app}\IAPplant\SysCore.bpl"
Type: files; Name: "{app}\IAP OPC Server\OPCDA.exe"
Type: files; Name: "{app}\IAPview\IAPview.exe"
Type: files; Name: "{app}\IAPview\Design.exe"

[Files]  
Source: "C:\Users\Administrator\Desktop\IAP_SP_V2.0.0.18.5\IAPplant\SysCore.bpl"; DestDir: "{app}\IAPplant"; Flags: ignoreversion  recursesubdirs createallsubdirs

Source: "C:\Users\Administrator\Desktop\IAP_SP_V2.0.0.18.5\IAPview\ConfigFile\Compile\*"; DestDir: "{app}\IAPview\ConfigFile\Compile"; Flags: ignoreversion  recursesubdirs createallsubdirs
Source: "C:\Users\Administrator\Desktop\IAP_SP_V2.0.0.18.5\IAPview\ConfigFile\ElementData\*"; DestDir: "{app}\IAPview\ConfigFile\ElementData"; Flags: ignoreversion  recursesubdirs createallsubdirs

Source: "C:\Users\Administrator\Desktop\IAP_SP_V2.0.0.18.5\IAPview\Design.exe"; DestDir: "{app}\IAPview"; Flags: ignoreversion  recursesubdirs createallsubdirs

Source: "C:\Users\Administrator\Desktop\IAP_SP_V2.0.0.18.5\IAPview\IAPview.exe"; DestDir: "{app}\IAPview"; Flags: ignoreversion  recursesubdirs createallsubdirs

Source: "C:\Users\Administrator\Desktop\IAP_SP_V2.0.0.18.5\IAP OPC Server\OPCDA.exe"; DestDir: "{app}\IAP OPC Server"; Flags: ignoreversion  recursesubdirs createallsubdirs


[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;