【转载】NSISADDIN播放注册机音乐+关于按钮+闪屏
innosetup吧
全部回复
仅看楼主
level 13
pf0800 楼主
一楼致度娘
2014年08月26日 05点08分 1
level 13
pf0800 楼主
此脚本可以实现播放XM、MOD、IT等常见的注册机音乐
脚本开始
2014年08月26日 06点08分 2
level 13
pf0800 楼主
; INNO SETUP 脚本文件
; 该示例脚本创建带闪屏和背景音乐的安装程序
; 使用了:
; - 用于添加闪屏和背景音乐的 NSIS 插件 NewAdvSplash.DLL,详见 http://nsis.sourceforge.net/NewAdvSplash_plug-in
; - 播放 MOD 音乐的插件 BASSMOD.DLL,详见 http://un4seen.com/bassmod.html
;
[Setup]
AppName=我的程序
AppVerName=我的程序 1.5 版本
DefaultDirName={pf}\我的程序
DefaultGroupName=我的程序
[Files]
; 打包实现闪屏和背景音乐所必需的插件文件
Source: Z:\NSISADDIN\callnsis.dll; DestDir: {tmp}; Flags: dontcopy
Source: Z:\NSISADDIN\NewAdvSplash.dll; DestDir: {tmp}; Flags: dontcopy
Source: Z:\NSISADDIN\Bassmod.dll; DestDir: {tmp}; Flags: dontcopy
; 打包闪屏和背景音乐素材文件:闪屏图像文件 bmp、gif 或者 jpg 格式, 音乐文件 MOD 格式
Source: Z:\NSISADDIN\splash.gif; DestDir: {tmp}; Flags: dontcopy
Source: Z:\NSISADDIN\mymusic.mod; DestDir: {tmp}; Flags: dontcopy
; 以下打包软件本身的文件
; 请自己加上
; 以下是安装脚本的其它段代码
; 请自己加上
2014年08月26日 06点08分 3
level 13
pf0800 楼主
[Code]
var
AboutButton: TButton;
MusicSwitchLabel0, MusicSwitchLabel1, MusicSwitchLabel2: TNewStaticText;
// 以下是所调用的插件函数
function BASSMOD_Init(device: Integer; freq, flags: DWORD): Boolean;
external *BASSMOD_Init@files:BASSMOD.dll stdcall delayload*;
procedure BASSMOD_MusicFree();
external *BASSMOD_MusicFree@files:BASSMOD.dll stdcall delayload*;
function BASSMOD_MusicLoad(mem: BOOL; f: PChar; offset: DWORD; length: DWORD; flags: DWORD): Boolean;
external *BASSMOD_MusicLoad@files:BASSMOD.dll stdcall delayload*;
function BASSMOD_MusicPlay(): Boolean;
external *BASSMOD_MusicPlay@files:BASSMOD.dll stdcall delayload*;
function BASSMOD_MusicPause(): Boolean;
external *BASSMOD_MusicPause@files:BASSMOD.dll stdcall delayload*;
procedure BASSMOD_Free();
external *BASSMOD_Free@files:BASSMOD.dll stdcall delayload*;
procedure callplug(parentwnd: Integer; pluginname,funcname,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10: PChar);
external *callplug@files:callnsis.dll stdcall delayload*;
// 以下是点击“关于”按钮后的响应函数
procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox(*这是你的信息。*
#13#
10*这是你的信息的第二行。*, mbInformation, MB_OK);
end;
2014年08月26日 06点08分 4
p.s.请将全角字符@换为@
2014年08月26日 06点08分
level 13
pf0800 楼主
// 以下是点击“关于”按钮后的响应函数
procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox(*这是你的信息。*
#13#
10*这是你的信息的第二行。*, mbInformation, MB_OK);
end;
// 以下是点击“打开音乐”按钮后的响应函数
procedure MusicSwitchLabel1OnClick(Sender: TObject);
begin
BASSMOD_MusicPlay;
MusicSwitchLabel1.Font.Color := clGray;
MusicSwitchLabel2.Font.Color := clBlue;
end;
// 以下是点击“关闭音乐”按钮后的响应函数
procedure MusicSwitchLabel2OnClick(Sender: TObject);
begin
BASSMOD_MusicPause;
MusicSwitchLabel2.Font.Color := clGray;
MusicSwitchLabel1.Font.Color := clBlue;
end;
2014年08月26日 06点08分 5
level 13
pf0800 楼主
// 安装向导初始化函数
procedure InitializeWizard();
var
BGMusicFile, SplashFile: string;
begin
// 创建“关于”按钮
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;
2014年08月26日 06点08分 6
level 13
pf0800 楼主
// 释放临时文件
ExtractTemporaryFile(ExpandConstant(*BASSMOD.dll*));
ExtractTemporaryFile(ExpandConstant(*CallNSIS.DLL*));
ExtractTemporaryFile(ExpandConstant(*NewAdvSplash.DLL*));
ExtractTemporaryFile(ExpandConstant(*mymusic.mod*));
ExtractTemporaryFile(ExpandConstant(*splash.gif*));
BGMusicFile := ExpandConstant(*{tmp}\mymusic.mod*);
SplashFile := ExpandConstant(*{tmp}\splash.gif*);
// 播放背景音乐
if not BASSMOD_Init(-1,44100,0) then
BASSMOD_Free;
BASSMOD_MusicFree;
if BASSMOD_MusicLoad(false, PChar(BGMusicFile), 0, 0, 4) then
BASSMOD_MusicPlay;
// 闪屏:显示时间 1600、淡入 800、淡出 500、透明颜色 -2 (表示 gif 图像本身透明)
CALLPLUG(0,ExpandConstant(*{tmp}\NewAdvSplash.dll*),*show*,*1600*,*800*,*500*,*-2*,SplashFile,**,**,**,**,**);
// 以下是安装向导初始化函数的其它代码
// 请自己加上
end;
// 以下是其它 CODE 段代码
// 请自己加上
2014年08月26日 06点08分 7
level 13
pf0800 楼主
脚本下载
下载 NSISADDIN_播放mod音乐.7z 文件
链接:[无效] http://pan.baidu.com/s/1o6OC1mE
密码:qjn8
2014年08月26日 06点08分 8
level 13
pf0800 楼主

附上2000多首注册机音乐:
链接:[无效] http://pan.baidu.com/s/1o6Hla4q
密码:mep3
2014年08月26日 06点08分 9
有么说么,这个厉害,稀缺资源。
2024年02月23日 11点02分
level 13
pf0800 楼主
这些音乐需要使用特殊软件播放
XM Play软件
链接:[无效] http://pan.baidu.com/s/1pJv4o7D
密码:nn6n
支持转换成MP3、WAV、OGG等常见格式
以XM转换MP3为例
2014年08月26日 06点08分 10
level 7
大福利怎么也没人来支持,看不下去了
2014年11月03日 08点11分 11
level 1
感谢楼主分享!
2023年12月01日 21点12分 12
level 1
这个是稀缺资源 [大拇指]
2024年02月23日 11点02分 13
1