Код:

[Setup]
AppName=LikeRusXP Localization
AppVerName={cm:NameAndVersion,LikeRusXP Localization,6.01.12}
AppVersion=6.01.12
DefaultDirName={pf}\LikeRusXP Localization
DefaultGroupName=LikeRusXP Localization
OutputBaseFilename=LikeRusXP 6.01.12
Compression=lzma
LicenseFile=embedded\License.txt
InfoBeforeFile=embedded\InfoBefore.txt
WizardImageFile=embedded\WizardImage.bmp
WizardSmallImageFile=embedded\WizardSmallImage.bmp
SetupIconFile={tmp}\MAINICON.ico
[Files]
Source: "{tmp}\isgsg.dll"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "{tmp}\Splash.png"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "{app}\bass.dll"; DestDir: "{tmp}"; Flags: dontcopy
Source: "{app}\sound.mp3"; DestDir: "{tmp}"; Flags: dontcopy
Source: "{tmp}\ISSkin.dll"; DestDir: "{app}"; Flags: dontcopy
Source: "{tmp}\Codejock.cjstyles"; DestDir: "{app}"; Flags: dontcopy
Source: "{app}\LikeRusXP.exe"; DestDir: "{app}"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
Source: "{app}\limage.exe"; DestDir: "{app}"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
Source: "{app}\LikeRusXP.chm"; DestDir: "{app}"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
Source: "{app}\License.txt"; DestDir: "{app}"; MinVersion: 4.1.2222,5.0;
Source: "{app}\Store\elibrary.dll"; DestDir: "{app}\Store"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
Source: "{app}\Store\lresdumper.dll"; DestDir: "{app}\Store"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
Source: "{app}\Store\sl3core.dll"; DestDir: "{app}\Store"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
Source: "{app}\Store\lires.exe"; DestDir: "{app}\Store"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
Source: "{app}\Store\rb\lresdumper.dll"; DestDir: "{app}\Store\rb"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
Source: "{app}\Store\rb\ResBinder.exe"; DestDir: "{app}\Store\rb"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
Source: "{app}\Store\rb\readme.txt"; DestDir: "{app}\Store\rb"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
Source: "{app}\Store\rb\english.uil"; DestDir: "{app}\Store\rb"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
Source: "{app}\Store\rb\russian.uil"; DestDir: "{app}\Store\rb"; MinVersion: 4.1.2222,5.0; Flags: ignoreversion
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; MinVersion: 4.1.2222,5.0;
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; MinVersion: 4.1.2222,5.0;
[Icons]
Name: "{group}\LikeRusXP 6.01.12"; Filename: "{app}\LikeRusXP.exe"; MinVersion: 4.1.2222,5.0;
Name: "{group}\{cm:ProgramOnTheWeb,LikeRusXP 6.01.12}"; Filename: "http://likerusxp.ru/"; MinVersion: 4.1.2222,5.0;
Name: "{group}\{cm:UninstallProgram,LikeRusXP 6.01.12}"; Filename: "{uninstallexe}"; MinVersion: 4.1.2222,5.0;
Name: "{commondesktop}\LikeRusXP 6.01.12"; Filename: "{app}\LikeRusXP.exe"; Tasks: "desktopicon"; MinVersion: 4.1.2222,5.0;
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\LikeRusXP"; Filename: "{app}\LikeRusXP.exe"; Tasks: "quicklaunchicon"; MinVersion: 4.1.2222,5.0;
////////////////////// Skin //////////////////////
[Code_]
#ifdef UNICODE
#define PStr "AnsiString"
#else
#define PStr "String"
#endif
procedure LoadSkin(lpszPath: {#PStr}; lpszIniFileName: {#PStr});
external 'LoadSkin@files:isskin.dll stdcall delayload setuponly';
procedure LoadSkinUninst(lpszPath: {#PStr}; lpszIniFileName: {#PStr});
external 'LoadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall delayload setuponly';
procedure UnloadSkinUninst();
external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('Codejock.cjstyles');
CreateDir(ExpandConstant('{sd}\ISSkin'));
FileCopy(ExpandConstant('{tmp}\Codejock.cjstyles'), ExpandConstant('{sd}\ISSkin\Codejock.cjstyles'), True);
LoadSkin(ExpandConstant('{sd}\ISSkin\Codejock.cjstyles'), 'NormalBlack.ini');
Result := True;
end;
procedure DeinitializeSetup();
begin
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
UnloadSkin();
DeleteFile(ExpandConstant('{sd}\ISSkin\isskin.dll'));
DeleteFile(ExpandConstant('{sd}\ISSkin\Codejock.cjstyles'));
RemoveDir(ExpandConstant('{sd}\ISSkin'));
end;
function InitializeUninstall(): Boolean;
begin
FileCopy(ExpandConstant('{app}\isskin.dll'),
ExpandConstant('{tmp}\isskin.dll'), True);
FileCopy(ExpandConstant('{app}\Codejock.cjstyles'),
ExpandConstant('{tmp}\Codejock.cjstyles'), True);
LoadSkinUninst(ExpandConstant('{tmp}\Codejock.cjstyles'), 'NormalBlack.ini');
Result := True;
end;
procedure DeinitializeUninstall();
begin
UnloadSkinUninst();
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssDone then
MsgBox('Программа ' + '{#SetupSetting("AppName")}' + ' установлена!', mbInformation, MB_OK);
end;
////////////////////// Musik //////////////////////
[Code_]
//большее указание смотрите в дельфийских исходниках в архиве с библиотекой
const
BASS_SAMPLE_LOOP = 4; //повторение
type
HSTREAM = DWORD; //тип звукового потока
function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean;
external 'BASS_Init@files:BASS.dll stdcall delayload';
function BASS_StreamCreateFile(mem: BOOL; f: PChar; offset: DWORD; length: DWORD; flags: DWORD): HSTREAM;
external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload';
function BASS_Start(): Boolean;
external 'BASS_Start@files:BASS.dll stdcall delayload';
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean;
external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload';
function BASS_Stop(): Boolean;
external 'BASS_Stop@files:BASS.dll stdcall delayload';
function BASS_Free(): Boolean;
external 'BASS_Free@files:BASS.dll stdcall delayload';
procedure InitializeWizard2();
var
Name1: string;
i: Integer;
begin
ExtractTemporaryFile('bass.dll');
ExtractTemporaryFile('sound.mp3');
if BASS_Init(-1, 44100, 0, 0, 0) then
begin
BASS_Start();
Name1:=ExpandConstant('{tmp}\sound.mp3');
i:=BASS_StreamCreateFile(FALSE, PChar(Name1), 0, 0, 4);
if i <> 0 then
begin
BASS_ChannelPlay(i, True);
end;
end;
end;
procedure DeInitializeSetup2();
begin
BASS_Stop(); //нужно для остановки проигрывания
BASS_Free(); //нужно для быстрой выгрузки библиотеки вместе с муз. файлом
end;
procedure CurStepChanged2(CurStep: TSetupStep);
begin
if CurStep = ssDone then
MsgBox('Программа ' + '{#SetupSetting("AppName")}' + ' установлена!', mbInformation, MB_OK);
end;
////////////////////// Splash //////////////////////
[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,False,$FFFFFF,10);
end;
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[Run]
Filename: "{app}\LikeRusXP.exe"; Description: "{cm:LaunchProgram,LikeRusXP}"; Flags: nowait postinstall skipifsilent