Search code examples
inno-setuppascalscript

Getting ISSkin to work with latest Inno Setup Unicode


I am trying for the first time ISSkin with Inno Setup. I wanted to try the black style. So I tried their sample:

[Setup]
AppName=ISSkin Example
AppVersion=1.0.0.2
DefaultDirName={pf}\ISSkin

[Files]
; Add the ISSkin DLL used for skinning Inno Setup installations.
Source: ISSkin.dll; DestDir: {app}; Flags: dontcopy

; Add the Visual Style resource contains resources used for skinning,
; you can also use Microsoft Visual Styles (*.msstyles) resources.
Source: Styles\Office2007.cjstyles; DestDir: {tmp}; Flags: dontcopy

[Icons]
Name: {group}\Uninstall =ISSkin; Filename: {app}\unins000.exe
[Code]
// The following code block is used to load the ISS, pass in
// NormalBlack.ini as the second parameter to LoadSkin to use
// the Black color scheme instead of the default Blue color
// scheme.

// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';

// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';

function InitializeSetup(): Boolean;
begin
    ExtractTemporaryFile('Office2007.cjstyles');
    LoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), 'NormalBlack.ini');
    Result := True;
end;

procedure DeinitializeSetup();
begin
    // Hide Window before unloading skin so user does not get
    // a glimse of an unskinned window before it is closed.
    ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
    UnloadSkin();
end;

I could not get it to work. The program looked normal.

I notice the software they provide is dated 2010. I am using latest Unicode Inno Setup.

How to do this skinning with it?


Solution

  • With Unicode version of Inno Setup you should use Unicode version of the plugin: ISSkinU.dll.

    [Files]
    Source: ISSkinU.dll; DestDir: {app}; Flags: dontcopy
    
    [Code]
    procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
    external 'LoadSkin@files:isskinU.dll stdcall';
    
    procedure UnloadSkin();
    external 'UnloadSkin@files:isskinU.dll stdcall';
    

    (rest of the code is the same as in your question)

    enter image description here