正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!
您需要 登录 才可以下载或查看,没有账号?立即注册
x
以前多个帖子都是播放 MIDI 的,所以今天写个播放 mp3 的,把下面的 mp3 文件改为 WMA 的文件也可以正常播放。
注意, midi ,wav 的文件不能适用于以下脚本,同时这两种音乐文件也不能循环播放,当然,如果是在实际的程序设计中,可以自己循环检测当前的播放状态,从而达到重复播放,但是却不可以在一个调用中实现重复播放。所以在安装程序中很难实现。
以下为脚本
- ; -- Components.iss --
- ; 安装程序背景音乐循环播放脚本演示
- [Setup]
- AppName=我的程序
- AppVerName=我的程序 版本 1.5
- DefaultDirName={pf}\我的程序
- DefaultGroupName=我的程序
- UninstallDisplayIcon={app}\MyProg.exe
- [Types]
- Name: "full"; Description: "完整安装"
- Name: "compact"; Description: "简洁安装"
- Name: "custom"; Description: "自定义安装"; Flags: iscustom
- [Components]
- Name: "program"; Description: "程序文件"; Types: full compact custom; Flags: fixed
- Name: "help"; Description: "帮助文件"; Types: full
- Name: "readme"; Description: "自述文件"; Types: full
- Name: "readme\en"; Description: "简体中文"; Flags: exclusive
- Name: "readme\de"; Description: "德文G"; Flags: exclusive
- [Files]
- Source: "MyProg.exe"; DestDir: "{app}"; Components: program
- Source: "MyProg.hlp"; DestDir: "{app}"; Components: help
- Source: "Readme.txt"; DestDir: "{app}"; Components: readme\en; Flags: isreadme
- Source: "Readme-German.txt"; DestName: "Liesmich.txt"; DestDir: "{app}"; Components: readme\de; Flags: isreadme
- Source: "sss.mp3"; DestDir: "{tmp}"; Flags: dontcopy
- [Icons]
- Name: "{group}\我的程序"; Filename: "{app}\MyProg.exe"
- [code]
- function mciSendString(lpstrCommand, lpstrReturnString: PChar; uReturnLength: UINT; hWndCallback: HWND): Integer;
- external 'mciSendStringA@winmm.dll stdcall';
- procedure InitializeWizard();
- var
- s: string;
- begin
- ExtractTemporaryFile(ExtractFileName(ExpandConstant('{tmp}\sss.mp3')));
- mciSendString(ExpandConstant('OPEN {tmp}\sss.mp3 TYPE MPEGVIDEO ALIAS BGMUSIC'),s,255,0);
- mciSendString(ExpandConstant('PLAY BGMUSIC REPEAT'),s,255,0);
- end;
复制代码 |