Skip to content

Commit

Permalink
Add installer
Browse files Browse the repository at this point in the history
  • Loading branch information
phobos2077 committed Jun 18, 2023
1 parent e026232 commit 8deee80
Show file tree
Hide file tree
Showing 12 changed files with 369 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.nodat
*.err
*.exe
*.dll
*.log
*.tmp
*.zip
Expand Down
4 changes: 2 additions & 2 deletions docs/ddraw_ini_settings.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[Misc]

VersionString=FALLOUT II 1.02d RPU v2.7 + map_update_v2 + EcCo v0.9
VersionString=FALLOUT II 1.02d RPU v26 + map_update_v2 + EcCo v0.9.1

DamageFormula=0

ObjCanHearObjFix=1

DerivedStats=sfall\stats.ini
SkillsFile=sfall\skills.ini
PerksFile=sfall\perks.ini
BooksFile=sfall\books.ini


MovieTimer_artimer1=120
MovieTimer_artimer2=235
MovieTimer_artimer3=350
Expand Down
3 changes: 3 additions & 0 deletions extra/build_installer.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF

C:\Programs\InnoSetup6\ISCC.exe /Qp installer.iss
File renamed without changes.
File renamed without changes.
Binary file added extra/fallout.ico
Binary file not shown.
147 changes: 147 additions & 0 deletions extra/installer.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
;;;
;;;
;;;

[Setup]
#define MyAppName "Fallout 2: EcCo Gameplay Overhaul"
#define MyAppVersion "0.9.1"
#define MyAppPublisher "phobos2077"

#define DocsDir "..\docs\"
#define RootDir "..\root\"

;#define WIDTH_ADJUST 200
;#define HEIGHT_ADJUST 200
;#define MyAppURL "http://www.nuclear-city.com/"

AppName={#MyAppName}
AppID=pbs_fallout2_economy_and_combat
AppVerName={#MyAppPublisher} {#MyAppName}
OutputBaseFilename=pbs_fo2rpu_ecco_mod_v0-9-1
DefaultDirName={sd}\Games\Fallout2\
AppendDefaultDirName=no
;UsePreviousAppDir=no
DirExistsWarning=no
UninstallFilesDir={app}
Uninstallable = no
CreateUninstallRegKey=no
AlwaysShowComponentsList=yes
;DisableDirPage=no
DisableProgramGroupPage=yes
DisableStartupPrompt=yes
DisableReadyPage=no
DisableWelcomePage=no
VersionInfoCompany={#MyAppPublisher}
VersionInfoDescription=
VersionInfoVersion={#MyAppVersion}
;SolidCompression=yes
;Compression=lzma
OutputDir=.

AppCopyright=Copyright © 2023, (phobos2077)
InfoBeforeFile={#DocsDir}ecco_readme.txt
SetupIconFile=fallout.ico
WizardSmallImageFile=phobos.bmp
WizardImageFile=wizard.bmp
WizardImageStretch=no
WizardStyle=modern
BackColor=clBlack
BackColor2=clRed

;ExtraDiskSpaceRequired=20971520
;PrivilegesRequired=admin
SetupLogging=yes

[Languages]
Name: "en"; MessagesFile: "compiler:default.isl"
Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl"
; InfoBeforeFile: "{#DocsDir}ecco_readme_ru.txt"

[CustomMessages]
; English
en.InstallFull=Full install
en.InstallCustom=Custom install
en.InstallNull=Uncheck all

en.CMain=EcCo mod
en.CEconomy=Economy Rebalance
en.CCombat=Combat Rebalance: weapons, ammo and items

en.WFalloutNotFound=Fallout not detected in selected directory (fallout2.exe), mod won't work. Install anyway?
en.WRPNotFound=Restoration Project not detected in selected directory! This mod is only compatible with RPU 2.6 or above. Are you sure you want to continue?
en.WRPMapUpdateNotFound=RPU: Maps Updated not detected in selected directory! This mod will not work without that. Are you sure you want to continue?
; Russian
ru.InstallFull=Ïîëíàÿ óñòàíîâêà
ru.InstallCustom=Âûáîðî÷íàÿ óñòàíîâêà
ru.InstallNull=Íè÷åãî íå âûáèðàòü
ru.CEconomy=Ýêîíîìè÷åñêèé ðåáàëàíñ
ru.CCombat=Áîåâîé Ðåáàëàíñ: Îðóæèå, áîåïðèïàñû è ïðåäìåòû
ru.WFalloutNotFound=Ïî óêàçàííîìó ïóòè íå íàéäåíà óñòàíîâëåííàÿ èãðà (fallout2.exe), ìîä íå áóäåò ðàáîòàòü! Âñå ðàâíî óñòàíîâèòü?
ru.WRPNotFound=Restoration Project íå îáíàðóæåí â óêàçàííîé ïàïêå! Äàííûé ìîä ñîâìåñòèì òîëüêî ñ RPU 2.6. Âñå ðàâíî ïðîäîëæèòü?
ru.WRPMapUpdateNotFound=RPU: Maps Updated íå îáíàðóæåí â óêàçàííîé ïàïêå! Äàííûé ìîä áåç íåãî ðàáîòàòü íå áóäåò. Âñ¸ ðàâíî ïðîäîëæèòü?
[Types]
Name: "full"; Description: "{cm:InstallFull}"
;Name: "custom"; Description: "{cm:InstallCustom}"; Flags: iscustom
;Name: "null"; Description: "{cm:InstallNull}"
[Components]
Name: "main"; Description: "EcCo mod"; Types: full; Flags: fixed
[InstallDelete]
Type: files; Name: "{app}\data\worldmap.dat"
; cleanup previous EcCo installations:
Type: filesandordirs; Name: "{app}\mods\rpu_y_ecco_pcx.dat"
Type: filesandordirs; Name: "{app}\mods\rpu_y_ecco_patch.dat"
Type: filesandordirs; Name: "{app}\mods\ecco"
[Files]
;
#define FLAGS "Flags: recursesubdirs createallsubdirs overwritereadonly"
;
Source: "{#RootDir}ddraw.dll"; DestDir: "{app}\";
Source: "{#RootDir}mods\*"; DestDir: "{app}\mods\"; {#FLAGS}
Source: "{#RootDir}sfall\*"; DestDir: "{app}\sfall\"; {#FLAGS}
Source: "{#DocsDir}ecco_readme.txt"; DestDir: "{app}\"
Source: "{#DocsDir}ecco_changelog.txt"; DestDir: "{app}\"
Source: "{#DocsDir}ecco_changelog_ru.txt"; DestDir: "{app}\"
;Source: "__batch\@pbs_rebalance_finalize.cmd"; DestDir: "{app}\"
#undef FLAGS
[INI]
; requirement
Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "DamageFormula"; String: "0"; Components: main
Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "ObjCanHearObjFix"; String: "1"; Components: main
Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "DerivedStats"; String: "sfall\stats.ini"; Components: main
Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "SkillsFile"; String: "sfall\skills.ini"; Components: main
Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "PerksFile"; String: "sfall\perks.ini"; Components: main
Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "BooksFile"; String: "sfall\books.ini"; Components: main
; dreams
Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "MovieTimer_artimer1"; String: "120"; Components: main
Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "MovieTimer_artimer2"; String: "235"; Components: main
Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "MovieTimer_artimer3"; String: "350"; Components: main
Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "MovieTimer_artimer4"; String: "470"; Components: main
;Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "CheckWeaponAmmoCost"; String: "1"; Components: combat
;Filename: "{app}\combat.ini"; Section: "APCOST"; Key: "drugs_free_uses"; String: "2"; Components: combat\inven_ap_drugs
;[Run]
;FileName: "{app}\@pbs_rebalance_finalize.cmd"; WorkingDir: "{app}"; Flags: shellexec waituntilterminated
; Optional:
;FileName: "{app}\weapon_chart.xls"; Description: "Îòêðûòü òàáëèöó õàðàêòåðèñòèê îðóæèÿ"; WorkingDir: "{app}"; Flags: postinstall shellexec unchecked
;FileName: "{app}\@pbs_rebalance_readme.rtf"; Description: "Îòêðûòü ReadMe"; WorkingDir: "{app}"; Flags: postinstall shellexec
; Code for additional effects
#include "installer_code.iss"
184 changes: 184 additions & 0 deletions extra/installer_code.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
[code]
function ValidateRequirement(FileName: String; MessageId: String): Boolean;
begin
result := true;
if not(FileExists(ExpandConstant('{app}\'+FileName))) then
begin
if MsgBox(CustomMessage(MessageId),mbError,MB_YESNO) <> IDYES then
begin
result := false;
end
end
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
result:= true;
if (curPageID = wpSelectDir) then
begin
if not(ValidateRequirement('fallout2.exe', 'WFalloutNotFound')) or
not(ValidateRequirement('mods\rpu.dat', 'WRPNotFound')) or
not(ValidateRequirement('mods\rpu_map_update.dat', 'WRPMapUpdateNotFound')) then
begin
result := false;
end
end
end;
// *********** clickable link
var
MouseLabel,SiteLabel: TLabel;
procedure SiteLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://www.nma-fallout.com/showthread.php?193578-Economy-and-Combat-Rebalance-mod', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode)
end;
procedure SiteLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
SiteLabel.Font.Color:=clRed
end;
procedure SiteLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
SiteLabel.Font.Color:=clBlue
end;
procedure SiteLabelMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
SiteLabel.Font.Color:=clGreen
end;
procedure SiteLabelMouseMove2(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
SiteLabel.Font.Color:=clBlue
end;
// components larger
type
TPositionStorage = array of Integer;
var
CompPageModified: Boolean;
CompPagePositions: TPositionStorage;
//procedure SaveComponentsPage(out Storage: TPositionStorage);
//begin
// SetArrayLength(Storage, 10);
//
// Storage[0] := WizardForm.Height;
// Storage[1] := WizardForm.NextButton.Top;
// Storage[2] := WizardForm.BackButton.Top;
// Storage[3] := WizardForm.CancelButton.Top;
// Storage[4] := WizardForm.ComponentsList.Height;
// Storage[5] := WizardForm.OuterNotebook.Height;
// Storage[6] := WizardForm.InnerNotebook.Height;
// Storage[7] := WizardForm.Bevel.Top;
// Storage[8] := WizardForm.BeveledLabel.Top;
// Storage[9] := WizardForm.ComponentsDiskSpaceLabel.Top;
//end;
//procedure LoadComponentsPage(const Storage: TPositionStorage;
// HeightOffset: Integer);
//begin
// if GetArrayLength(Storage) <> 10 then
// RaiseException('Invalid storage array length.');
//
// WizardForm.Height := Storage[0] + HeightOffset;
// WizardForm.NextButton.Top := Storage[1] + HeightOffset;
// WizardForm.BackButton.Top := Storage[2] + HeightOffset;
// WizardForm.CancelButton.Top := Storage[3] + HeightOffset;
// WizardForm.ComponentsList.Height := Storage[4] + HeightOffset;
// WizardForm.OuterNotebook.Height := Storage[5] + HeightOffset;
// WizardForm.InnerNotebook.Height := Storage[6] + HeightOffset;
// WizardForm.Bevel.Top := Storage[7] + HeightOffset;
// WizardForm.BeveledLabel.Top := Storage[8] + HeightOffset;
// WizardForm.ComponentsDiskSpaceLabel.Top := Storage[9] + HeightOffset;
//end;
procedure AdjustSize(ctrl: TControl; widthOfs: Integer; heightOfs: Integer);
begin
ctrl.Width := ctrl.Width + widthOfs;
ctrl.Height := ctrl.Height + heightOfs;
end;
procedure AdjustPos(ctrl: TControl; widthOfs: Integer; heightOfs: Integer);
begin
ctrl.Left := ctrl.Left + widthOfs;
ctrl.Top := ctrl.Top + heightOfs;
end;
//procedure ResizeWizard(WidthOfs: Integer; HeightOfs: Integer);
//begin
// AdjustPos(WizardForm, -WidthOfs div 2, -HeightOfs div 2);
// AdjustSize(WizardForm, WidthOfs, HeightOfs);
// with WizardForm do begin
// AdjustPos(NextButton, WidthOfs, HeightOfs);
// AdjustPos(BackButton, WidthOfs, HeightOfs);
// AdjustPos(CancelButton, WidthOfs, HeightOfs);
// AdjustPos(Bevel, 0, HeightOfs);
// AdjustSize(Bevel, WidthOfs, 0);
// AdjustSize(Bevel1, WidthOfs, 0);
// AdjustPos(BeveledLabel, 0, HeightOfs);
// AdjustPos(ComponentsDiskSpaceLabel, 0, HeightOfs);
// AdjustSize(PageNameLabel, WidthOfs, 0);
// AdjustSize(PageDescriptionLabel, WidthOfs, 0);
// AdjustPos(WizardSmallBitmapImage, WidthOfs, 0);
// AdjustSize(FilenameLabel, WidthOfs, 0);
// AdjustPos(DirBrowseButton, WidthOfs, 0);
// AdjustSize(DirEdit, WidthOfs, 0);
// AdjustSize(SelectDirLabel, WidthOfs, 0);
// AdjustSize(SelectComponentsLabel, WidthOfs, 0);
// AdjustSize(SelectTasksLabel, WidthOfs, 0);
// AdjustSize(TypesCombo, WidthOfs, 0);
// AdjustSize(MainPanel, WidthOfs, 0);
// AdjustSize(ComponentsList, WidthOfs, HeightOfs);
// AdjustSize(OuterNotebook, WidthOfs, HeightOfs);
// AdjustSize(InnerNotebook, WidthOfs, HeightOfs);
// AdjustSize(InfoBeforeMemo, WidthOfs, HeightOfs);
// AdjustSize(InfoAfterMemo, WidthOfs, HeightOfs);
// AdjustSize(ReadyMemo, WidthOfs, HeightOfs);
// AdjustSize(ProgressGauge, WidthOfs, 0);
// AdjustSize(WizardBitmapImage, 0, HeightOfs);
// AdjustSize(WizardBitmapImage2, 0, HeightOfs);
// end;
//end;
procedure InitializeWizard();
begin
//MouseLabel:=TLabel.Create(WizardForm)
//MouseLabel.Width:=WizardForm.Width
//MouseLabel.Height:=WizardForm.Height
//MouseLabel.Autosize:=False
//MouseLabel.Transparent:=True
//MouseLabel.OnMouseMove:=@SiteLabelMouseMove2
//MouseLabel.Parent:=WizardForm
SiteLabel:=TLabel.Create(WizardForm)
SiteLabel.Left:=10
SiteLabel.Top:=330
SiteLabel.Cursor:=crHand
SiteLabel.Font.Color:=clBlue
SiteLabel.Caption:='phobos2077 EcCo mod'
SiteLabel.OnClick:=@SiteLabelOnClick
SiteLabel.OnMouseDown:=@SiteLabelMouseDown
SiteLabel.OnMouseUp:=@SiteLabelMouseUp
SiteLabel.OnMouseMove:=@SiteLabelMouseMove
SiteLabel.Parent:=WizardForm
//ResizeWizard(200, 200);
CompPageModified := False;
end;
4 changes: 2 additions & 2 deletions extra/makedat.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ SET cwd=%cd%
cd /d "%~dp0..\"

SET root=%cd%
SET mainDat=ecco.dat
SET mainDat=rpu_y_ecco.dat

if exist %mainDat% del %mainDat%

cd /d "%root%\root\data"
%root%\extra\bin\dat2.exe a -r %mainDat% art\* data\* maps\* pcx\* proto\* scripts\* sound\* text\*
move %mainDat% %root%\
move %mainDat% %root%\root\mods\

cd /d "%cwd%"
Binary file added extra/phobos.bmp
Binary file not shown.
Binary file added extra/wizard.bmp
Binary file not shown.
Loading

0 comments on commit 8deee80

Please sign in to comment.