/ 以下是点击“关于”按钮后的响应函数
procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox(* 圣诞故事:胡桃夹子中文版*#13#10**#13#10*本程序使用防解包修改版的Inno Setup 5.5.2.0构建*#13#10* *, mbInformation, MB_OK);
end;
// 以下是点击“打开音乐”按钮后的响应函数
procedure MusicSwitchLabel1OnClick(Sender: TObject);
begin
BASS_ChannelPlay(channel, false);
MusicSwitchLabel1.Font.Color := clGray;
MusicSwitchLabel2.Font.Color := clBlue;
end;
// 以下是点击“关闭音乐”按钮后的响应函数
procedure MusicSwitchLabel2OnClick(Sender: TObject);
begin
BASS_ChannelPause(channel);
MusicSwitchLabel2.Font.Color := clGray;
MusicSwitchLabel1.Font.Color := clBlue;
end;
// 安装向导初始化函数
procedure InitializeWizard();
var
AboutButton: TButton;
BGMusicFile, SplashFile: string;
begin
RedesignWizardForm;
// 创建“关于”按钮
AboutButton := TButton.Create(WizardForm);
AboutButton.Left := WizardForm.ClientWidth - WizardForm.CancelButton.Left - WizardForm.CancelButton.Width;
AboutButton.Top := WizardForm.CancelButton.Top;
AboutButton.Width := WizardForm.CancelButton.Width;
AboutButton.Height := WizardForm.CancelButton.Height;
AboutButton.Caption := *关于(&A)...*;
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Parent := WizardForm;
// 创建文字标签“音乐:”
MusicSwitchLabel0 := TNewStaticText.Create(WizardForm);
MusicSwitchLabel0.Left := AboutButton.Left + ScaleX(90);
MusicSwitchLabel0.Top := WizardForm.CancelButton.Top + ScaleY(3);
MusicSwitchLabel0.Width := ScaleX(30);
MusicSwitchLabel0.Height := ScaleY(12);
MusicSwitchLabel0.Font.Color := clRed;
MusicSwitchLabel0.Caption := *音乐:*;
MusicSwitchLabel0.Parent := WizardForm;
// 创建文字标签作为“打开音乐”按钮(采用 Webdings 字体中的播放符号)
MusicSwitchLabel1 := TNewStaticText.Create(WizardForm);
MusicSwitchLabel1.Left := MusicSwitchLabel0.Left + ScaleX(33);
MusicSwitchLabel1.Top := MusicSwitchLabel0.Top - ScaleY(3);
MusicSwitchLabel1.Width := ScaleX(20);
MusicSwitchLabel1.Height := ScaleY(12);
MusicSwitchLabel1.Font.Color := clGray;
MusicSwitchLabel1.Font.Name := *webdings*;
MusicSwitchLabel1.Font.Size := -15;
MusicSwitchLabel1.Cursor := crCross;
MusicSwitchLabel1.Caption := #52
MusicSwitchLabel1.ShowHint:= true;
MusicSwitchLabel1.Hint:= *打开音乐*;
MusicSwitchLabel1.OnClick := @MusicSwitchLabel1OnClick;
MusicSwitchLabel1.Parent := WizardForm;
// 创建文字标签作为“关闭音乐”按钮(采用 Webdings 字体中的暂停符号)
MusicSwitchLabel2 := TNewStaticText.Create(WizardForm);
MusicSwitchLabel2.Left := MusicSwitchLabel1.Left + ScaleX(20);
MusicSwitchLabel2.Top := MusicSwitchLabel0.Top - ScaleY(3);
MusicSwitchLabel2.Width := ScaleX(20);
MusicSwitchLabel2.Height := ScaleY(12);
MusicSwitchLabel2.Font.Color := clBlue;
MusicSwitchLabel2.Font.Name := *webdings*;
MusicSwitchLabel2.Font.Size := -15;
MusicSwitchLabel2.Cursor := crCross;
MusicSwitchLabel2.Caption := #59
MusicSwitchLabel2.ShowHint:= true;
MusicSwitchLabel2.Hint:= *关闭音乐*;
MusicSwitchLabel2.OnClick := @MusicSwitchLabel2OnClick;
MusicSwitchLabel2.Parent := WizardForm;
// 释放临时文件
ExtractTemporaryFile(*BASS.dll*);
ExtractTemporaryFile(*CallNSIS.DLL*);
ExtractTemporaryFile(*NewAdvSplash.DLL*);
ExtractTemporaryFile(*music.mp3*);
ExtractTemporaryFile(*splash.bmp*);
BGMusicFile := ExpandConstant(*{tmp}\music.mp3*);
SplashFile := ExpandConstant(*{tmp}\splash.bmp*);
// 播放背景音乐
if not BASS_Init(-1,44100,0,0,**) then
BASS_Free;
sample := BASS_SampleLoad(false, PChar(BGMusicFile), 0, 0, 1, 4);
if sample<>0 then
begin
channel:= BASS_SampleGetChannel(sample, false);
BASS_ChannelPlay(channel, true);
end;
// 闪屏:显示时间 1600、淡入 800、淡出 500、透明颜色 -2 (表示 gif 图像本身透明)
callplug(0,ExpandConstant(*{tmp}\NewAdvSplash.dll*),*show*,*1600*,*800*,*500*,*-2*,SplashFile,**,**,**,**,**);
DeleteMenu(GetSystemMenu(wizardform.handle,false),8,MF_BYPOSITION);
DeleteMenu(GetSystemMenu(wizardform.handle,false),7,MF_BYPOSITION);
// 调整组件列表的大小
WizardForm.TYPESCOMBO.Visible:= false;
WizardForm.ComponentsList.Height := WizardForm.ComponentsList.Height + WizardForm.ComponentsList.Top - WizardForm.TYPESCOMBO.Top;
WizardForm.ComponentsList.Top := WizardForm.TYPESCOMBO.Top;
WizardForm.ComponentsList.Width := ScaleX(200);
//创建一个虚拟的GroupBox,因为Inno Setup 没有啊。
InfoPanel := TPanel.Create(WizardForm);
InfoPanel.Parent := WizardForm.SelectComponentsPage;
InfoPanel.Caption := **;
InfoPanel.Top := WizardForm.ComponentsList.Top;
InfoPanel.Left := ScaleX(216);
InfoPanel.Width := ScaleX(200);
InfoPanel.Height := WizardForm.ComponentsList.Height;
InfoPanel.BevelInner := bvRaised;
InfoPanel.BevelOuter := bvLowered;
InfoCaption := TNewStaticText.Create(WizardForm);
InfoCaption.Parent := WizardForm.SelectComponentsPage;
InfoCaption.Caption := *描述*;
InfoCaption.Left := ScaleX(224);
InfoCaption.Top := InfoPanel.Top - ScaleY(5);
InfoCaption.Font.Color := clActiveCaption;
// 创建描述文字
Info := TNewStaticText.Create(WizardForm);
Info.Parent := InfoPanel;
Info.AutoSize := False;
Info.Left := ScaleX(6);
Info.Width := ScaleX(188);
Info.Top := ScaleY(12);
Info.Height := WizardForm.ComponentsList.Height - ScaleY(18);
Info.Caption := *移动你的鼠标指针到组件之上,便可见到它的描述。*;
Info.WordWrap := true;
//激活描述控制
enabledesc(WizardForm.ComponentsList.Handle,Info.Handle,
*游戏主文件,不准去除!!;*+
*游戏的附加内容,有壁纸、音乐、屏保,总之是好东西!;*+
*游戏的精美壁纸;*+
*游戏的屏保;*+
*游戏的原声音乐;*
);
end;