Dielo
Dielo

Reputation: 633

Inno Setup - Transparent Splash Screen

I have a problem and I need your help..I want to find a differente way to put a transparent splash screen or the correction of my code. The code here works... but there is a problem, some people get an error at the end of the installation.

This is how look the error at the end of the installation enter image description here

enter image description here

I check another lines in my code and I found that the problem was the code of the splash screen, if I delete it the installer works perfect, I see that what I need is a procedure DeinitializeSetup(); but I don't know how tu put it in the splash screen section, I get this kind of error if I delete the procedure DeinitializeSetup(); in another codes, like skin, logo, etc.. the files that goes to temp folder of windows... then what I need is the procedure DeinitializeSetup(); in the splash screen code to solve this... :( here is the dll file for anyone to test IsUtilsHb.dll

then...please if anybody know a different way to put a transparent splash screen... ill be grateful.. or better.. to fix this code section :)

[setup]
AppName=Slash PNG
AppVerName=1.0
DefaultDirName={pf}\program

[Languages]
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

[Files]
Source: IsUtilsHb.dll; DestDir: {app}; Flags: dontcopy
Source: SplashScreen.png; DestDir: {app}; Flags: dontcopy

[Code]
function SplashScreen(hWnd: Integer; pathPng: String; nSleep: Integer): Integer;
external 'SplashScreen@files:IsUtilsHb.dll stdcall';

procedure InitializeWizard();
var 
  SplashFileName: string;
begin
  SplashFileName := ExpandConstant('{tmp}\SplashScreen.png');
  ExtractTemporaryFile('SplashScreen.png');
  SplashScreen(StrToInt(ExpandConstant('{hwnd}')), SplashFileName, 5000);
end;

Upvotes: 2

Views: 5890

Answers (2)

Dielo
Dielo

Reputation: 633

After looking all around the internet, I got this solution:

This is the DLL am using: isgsg.dll

[setup]
AppName=Slash PNG
AppVerName=1.0
DefaultDirName={pf}\program

[Languages]
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

Source: "Splash.png"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: isgsg.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression

[Code]
procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';

procedure InitializeWizard();
begin
  ExtractTemporaryFile('Splash.png');
  ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}\Splash.png'),1000,3000,1000,0,255,True,$FFFFFF,10);
end;

Upvotes: 2

user3197960
user3197960

Reputation: 21

Just added:

ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}\Splash.png'),1000,3000,1000,0,255,True,$FFFFFF,10);

Interpretation:

ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}\Splash.png'),1000(appear time),3000(show time),1000(disappear time),0(like a intermittent reload time),255(transparency 0..255),True,$FFFFFF (transparency color if not png transp),10); 

like a intermittent reload time = use 9999999 and you see like a thunder image

Upvotes: 1

Related Questions