3

I have a problem with loading VCL Styles for Inno Setup. The installer generates correctly, but still remains an old style. New styles will not load.

I do not understand why this is happening. Please help!

Here my iss code:

[Files]
...
; add library to create new styles
Source: "VclStylesinno.dll"; DestDir: {app}; Flags: dontcopy
Source: "Styles/Pink.vsf"; DestDir: {app}; Flags: dontcopy

[Code]

// Import the LoadVCLStyle function from VclStylesInno.DLL
procedure LoadVCLStyle(VClStyleFile: String);
  external 'LoadVCLStyleW@files:VclStylesInno.dll stdcall';
// Import the UnLoadVCLStyles function from VclStylesInno.DLL
procedure UnLoadVCLStyles;
  external 'UnLoadVCLStyles@files:VclStylesInno.dll stdcall';

function InitializeSetup(): Boolean;
begin
   ExtractTemporaryFile('Pink.vsf');
   LoadVCLStyle(ExpandConstant('Pink.vsf'));
   Result := True;
end;
4

1 回答 1

1

只需遵循VCL 样式示例脚本

function InitializeSetup(): Boolean;
begin
  ExtractTemporaryFile('Amakrits.vsf');
  LoadVCLStyle(ExpandConstant('{tmp}\Amakrits.vsf'));
  Result := True;
end;

注意{tmp}\.

您没有提供样式文件的路径,因此LoadVCLStyle失败,因为它找不到文件。

于 2016-04-14T08:21:09.133 回答