[Setup]
AppName=InvisibleCubes
AppVerName=InvisibleCubes 1.0
AppPublisher=Gerich
AppPublisherURL=http://w4tweaks.ucoz.ru/
AppSupportURL=http://w4tweaks.ucoz.ru/
AppUpdatesURL=http://w4tweaks.ucoz.ru/
DisableDirPage=yes
DisableProgramGroupPage=yes
DefaultDirName={pf}\W4MapPackLauncher\installed\InvisibleCubes
DefaultGroupName=W4MapPac kLauncher\Maplists\InvisibleCubes
OutputDir=C:\Documents and Settings\Администратор\Рабочий стол
OutputBaseFilename=InvisibleCubes
SetupIconFile=C:\Program Files\W4MapPackEditor\iscc\setup.ico
Compression=lzma
SolidCompression=yes
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\russian.isl"
Name: "english"; MessagesFile: "compiler:Default.isl"
[CustomMessages]
CopyingFiles = Copying files to Worms 4 Mayhem directory
CopyingFilesLong = All needed files will be copyed to Worms 4 Mayhem directory and to W4MapPackLauncher.
Backup = Select files to copy and backup
BackupLong = If you have some changed files, you should select to replace these files with standart files. You can also backup them
WormsNotFound = Worms 4 Mayhem not found
LauncherNotFound = W4MapPackLauncher not found. Visit
http://w4tweaks.ucoz.ru/index/0-6 Progress = Copying file
[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,InvisibleCubes}"; Filename: "http://w4tweaks.ucoz.ru/"
Name: "{group}\{cm:UninstallProgram,InvisibleCubes}"; Filename: "{uninstallexe}"
[Files]
Source: "C:\Program Files\W4MapPackEditor\iscc\maplists\InvisibleCubes.mpl"; DestName:"1.tmp"; Flags: dontcopy
Source: "C:\Documents and Settings\Администратор\Рабочий стол\1.JPG"; DestName:"2.tmp"; Flags: dontcopy
Source: "C:\Documents and Settings\Администратор\Рабочий стол\2.JPG"; DestName:"3.tmp"; Flags: dontcopy
Source: "C:\Documents and Settings\Администратор\Рабочий стол\3.JPG"; DestName:"4.tmp"; Flags: dontcopy
Source: "C:\Documents and Settings\Администратор\Рабочий стол\Info_rus.htm"; DestName:"5.tmp"; Flags: dontcopy
Source: "C:\Documents and Settings\Администратор\Рабочий стол\Info_en.htm"; DestName:"6.tmp"; Flags: dontcopy
Source: "C:\Documents and Settings\Администратор\Рабочий стол\InvisibleCubes2.xan"; DestName:"8.tmp"; Flags: dontcopy
Source: "D:\SG\GAMES\Worms 4 Mayhem\data\Maps\CarpetCapers.hmp"; DestName:"10.tmp"; Flags: dontcopy
Source: "C:\Documents and Settings\Администратор\Рабочий стол\icon.tga"; DestName:"12.tmp"; Flags: dontcopy
[UninstallDelete]
Type: filesandordirs; Name: "{code:getLauncherDir}\maplists\InvisibleCubes.mpl"
[Code]
var
CountToCopy:integer;
LauncherDir,WormsDir: String;
CopyingFiles: TOutputProgressWizardPage;
FilesCopyed:integer;
procedure InitializeWizard();
begin
CopyingFiles:=CreateOutputProgressPage(ExpandConstant('{cm:CopyingFiles}'), ExpandConstant('{cm:CopyingFilesLong}'));
end;
function InitializeUninstall(): Boolean;
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Gerich\W4MapPackLauncher','AppDir', LauncherDir);
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Gerich\W4MapPackLauncher', 'WormsDir', WormsDir);
result:=true;
end;
function getLauncherDir(Param: String): String;
begin
result:=LauncherDir;
end;
procedure CopyToWorms(FileToExtract:string;Where:string;realname:string);
var
Dest:string;
begin
CopyingFiles.SetText(ExpandConstant('{cm:Progress}'),FileToExtract);
Dest:=WormsDir+Where+realname;
ExtractTemporaryFile(FileToExtract);
if FileExists(Dest) then
begin
if not DirExists(WormsDir+Where+'backup\') then
CreateDir(WormsDir+Where+'backup\');
FileCopy(Dest,WormsDir+Where+'backup\'+FileToExtract,true);
end;
FileCopy(ExpandConstant('{tmp}\')+FileToExtract,Dest,false);
FilesCopyed:=FilesCopyed+1;
CopyingFiles.SetProgress(FilesCopyed,CountToCopy);
end;
procedure CopyToMaplists(FileToExtract:string;Where:string;realname:string);
var
Dest:string;
begin
CopyingFiles.SetText(ExpandConstant('{cm:Progress}'),FileToExtract);
Dest:=LauncherDir+'maplists\'+Where+realname;
ExtractTemporaryFile(FileToExtract);
if FileExists(Dest) then
begin
if not DirExists(LauncherDir+'maplists\'+Where+'backup\') then
CreateDir(LauncherDir+'maplists\'+Where+'backup\');
FileCopy(Dest,LauncherDir+'maplists\'+Where+'backup\'+realname,true);
end;
FileCopy(ExpandConstant('{tmp}\')+FileToExtract,Dest,false);
FilesCopyed:=FilesCopyed+1;
CopyingFiles.SetProgress(FilesCopyed,CountToCopy);
end;
procedure CreateSubDir(dir:string;Where:string);
begin
if DirExists(LauncherDir+'maplists\'+Where) then
CreateDir(LauncherDir+'maplists\'+Where+dir);
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result:=True;
case CurPageID of
wpReady:
begin
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Gerich\W4MapPackLauncher','AppDir', LauncherDir) then
begin
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Gerich\W4MapPackLauncher', 'WormsDir', WormsDir) then
begin
if not DirExists(LauncherDir+'maplists\') then
CreateDir(LauncherDir+'maplists\')
end
else
begin
MsgBox(ExpandConstant('{cm:WormsNotFound}'), mbInformation, MB_OK);
Result := False;
exit;
end;
end
else
begin
MsgBox(ExpandConstant('{cm:LauncherNotFound}'), mbInformation, MB_OK);
Result := False;
exit;
end;
try
begin
FilesCopyed:=0;
CountToCopy:=9;
CopyingFiles.Show;
CopyToMaplists('1.tmp','','InvisibleCubes.mpl');
CopyToMaplists('2.tmp','','1.JPG');
CopyToMaplists('3.tmp','','2.JPG');
CopyToMaplists('4.tmp','','3.JPG');
CopyToMaplists('5.tmp','','Info_rus.htm');
CopyToMaplists('6.tmp','','Info_en.htm');
CopyToWorms('8.tmp','data\maps\','InvisibleCubes.xan');
CopyToWorms('10.tmp','data\maps\','InvisibleCubes.hmp');
CopyToWorms('12.tmp','data\frontend\levels\','InvisibleCubes.tga');
end;
finally
CopyingFiles.Hide;
end;
end;
end;
end;