我想在设置开始之前添加启动画面。我没有找到想法。我曾尝试在帖子中使用一段代码,但我没有得到启动画面。
[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;
- 我的代码如下
#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{08CBDC11-A20E-49F7-A482-C384130DAC65}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "E:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: E:\BUILD\Splash Screen\isgsg.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: E:\BUILD\Splash Screen\*; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[代码] 过程ShowSplashScreen(p1:HWND; p2:string; p3,p4,p5,p6,p7:integer; p8:boolean; p9:Cardinal; p10:integer);外部' ShowSplashScreen @文件:isgsg.dll stdcall delayload';
procedure InitializeWizard();
var
SplashFileName: string;
begin
//SplashFileName := ExpandConstant('{tmp}\test2.bmp');
SplashFileName := 'E:\BUILD\Splash Screen\Manas.png';
//ExtractTemporaryFile('test2.bmp');
//SplashScreen(StrToInt(ExpandConstant('{hwnd}')), SplashFileName, 2000);
ShowSplashScreen(WizardForm.Handle,SplashFileName,1000,3000,1000,0,255,True,$FFFFFF,10);
end;