Skip to content

Commit cb92293

Browse files
committed
initial commit
0 parents  commit cb92293

12 files changed

Lines changed: 171 additions & 0 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ProjectD2Installer.exe
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
pushd %~dp0
2+
3+
regsvr32 /u /s MSCOMCTL.OCX
4+
regsvr32 /u /s .\MSCOMCTL.OCX
5+
regsvr32 /s .\MSCOMCTL.OCX
6+
7+
winmpq.exe d ../../d2char.mpq (attributes)
8+
winmpq.exe d ../../d2data.mpq (attributes)
9+
winmpq.exe d ../../d2sfx.mpq (attributes)

Files/MPQFixer/MSCOMCTL.OCX

1.03 MB
Binary file not shown.

Files/MPQFixer/SFMPQ.dll

188 KB
Binary file not shown.

Files/MPQFixer/VB40032.DLL

704 KB
Binary file not shown.

Files/MPQFixer/WinMPQ.exe

347 KB
Binary file not shown.

Files/PD2Launcher.exe

2.44 MB
Binary file not shown.

Files/sciter.dll

7.24 MB
Binary file not shown.

ProjectD2Installer.iss

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
;Made with Inno Setup 5.5.9 Ansi - https://files.jrsoftware.org/is/5/innosetup-5.5.9.exe
2+
;#include <.\ISTheme\ISTheme.iss>
3+
4+
5+
[CustomMessages]
6+
GameNotFound=Game files not found in %1 %n%nPlease select a valid Diablo II: Lord of Destruction folder.%n%nNote: If you do not own the game yet, you can buy a copy here: https://eu.shop.battle.net/ (Download the English version)
7+
InstallingApp=Installing %1, this may take several minutes...
8+
EnglishInstallRequired=Project Diablo 2 requires a -English- game installation of Diablo II: Lord of Destruction, please do not try to install it on any other game language or the game will crash randomly.
9+
SelectDiablo2Folder=Please select a valid (English) Diablo II: Lord of Destruction folder.
10+
CheckFile=d2exp.mpq
11+
GameRegEng=SOFTWARE\Blizzard Entertainment\Diablo II
12+
13+
[Setup]
14+
AppId={{822B3055-5F16-4934-A1FC-378AB0181A66}
15+
AppName=Project Diablo 2
16+
AppVersion=1.0
17+
AppVerName=Project Diablo 2
18+
AppPublisher=projectdiablo2.com
19+
VersionInfoVersion=1.0.0.0
20+
VersionInfoTextVersion=1.0.0.0
21+
VersionInfoProductName=Project Diablo 2
22+
VersionInfoDescription=Project Diablo 2
23+
AppPublisherURL=https://www.projectdiablo2.com/
24+
AppSupportURL=https://www.projectdiablo2.com/
25+
AppUpdatesURL=https://www.projectdiablo2.com/
26+
DirExistsWarning=no
27+
DefaultDirName={code:DefaultDir}
28+
DisableProgramGroupPage=yes
29+
DisableReadyPage=yes
30+
DisableWelcomePage=yes
31+
DisableFinishedPage=yes
32+
AllowNoIcons=yes
33+
OutputBaseFilename=ProjectD2Installer
34+
Compression=lzma2/max
35+
SolidCompression=no
36+
UsePreviouslanguage=no
37+
CreateUninstallRegKey=yes
38+
UsePreviousAppDir=no
39+
SourceDir=.
40+
OutputDir=.
41+
SetupIconFile=Resources\PD2_Icon.ico
42+
AppendDefaultDirName=no
43+
ShowLanguageDialog=no
44+
RestartIfNeededByRun=no
45+
UninstallFilesDir={app}\ProjectD2
46+
47+
[Languages]
48+
Name: "english"; MessagesFile: "compiler:Default.isl"
49+
50+
[Files]
51+
Source: Files\*; DestDir: "{app}\ProjectD2"; Flags: ignoreversion
52+
Source: Files\MpqFixer\*; DestDir: "{app}\ProjectD2\MpqFixer"; Flags: ignoreversion
53+
54+
Source: Resources\VC_redist.x86.exe; Flags: dontcopy
55+
Source: Resources\VC_redist.x64.exe; Flags: dontcopy
56+
57+
[Icons]
58+
Name: "{commondesktop}\Project Diablo 2"; Filename: "{app}\ProjectD2\PD2Launcher.exe"; WorkingDir: "{app}\ProjectD2"
59+
Name: "{app}\ProjectD2\Uninstall Project Diablo 2"; Filename: "{uninstallexe}"; WorkingDir: "{app}\ProjectD2"
60+
61+
[Run]
62+
Filename: "{tmp}\VC_redist.x86.exe"; Parameters: "/install /passive /norestart"; Flags: runascurrentuser; Check: FileExists(ExpandConstant('{tmp}\VC_redist.x86.exe')) and ChangeStatusLabel('Visual C++ Redistributable 2019 (x86)')
63+
64+
Filename: "{tmp}\VC_redist.x64.exe"; Parameters: "/install /passive /norestart"; Flags: runascurrentuser; Check: FileExists(ExpandConstant('{tmp}\VC_redist.x64.exe')) and ChangeStatusLabel('Visual C++ Redistributable 2019 (x64)')
65+
66+
Filename: "{app}\ProjectD2\MpqFixer\FIX_MPQS_RUN_AS_ADMIN.bat"; WorkingDir: "{app}\ProjectD2\MpqFixer"; Flags: runascurrentuser; Check: ChangeStatusLabel('MPQFixer')
67+
68+
Filename: "{app}\ProjectD2\PD2Launcher.exe"; WorkingDir: "{app}\ProjectD2"; Description: "{cm:LaunchProgram,Project Diablo 2}"; Flags: nowait postinstall runascurrentuser skipifsilent
69+
70+
[UninstallDelete]
71+
Type: filesandordirs; Name: "{app}\ProjectD2"
72+
73+
74+
[Registry]
75+
Root: HKLM; Subkey: Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers; ValueType: String; ValueName: {app}\ProjectD2\PD2Launcher.exe; ValueData: "RUNASADMIN"; Check: not IsWin64
76+
77+
Root: HKLM64; Subkey: Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers; ValueType: String; ValueName: {app}\ProjectD2\PD2Launcher.exe; ValueData: "RUNASADMIN"; Check: IsWin64
78+
79+
Root: HKCU; Subkey: Software\Wine\AppDefaults\game.exe\DllOverrides; ValueType: string; ValueName: "ddraw"; ValueData: "native, builtin"; Check: RunsOnWine
80+
81+
Root: HKCU; Subkey: Software\Blizzard Entertainment\Diablo II; ValueType: string; ValueName: "InstallPath"; ValueData: {app}
82+
83+
84+
[Code]
85+
function GetModuleHandleA(lpLibFileName: PAnsiChar): THandle;
86+
external 'GetModuleHandleA@kernel32.dll stdcall';
87+
function GetProcAddress(Module: THandle; ProcName: PAnsiChar): Longword;
88+
external 'GetProcAddress@kernel32.dll stdcall';
89+
90+
function RunsOnWine(): boolean;
91+
begin
92+
Result := GetProcAddress(GetModuleHandleA('ntdll.dll'), 'wine_get_version')<> 0;
93+
end;
94+
95+
function DefaultDir(Param: String): String;
96+
var
97+
gamepath: String;
98+
begin
99+
gamepath:=ExpandConstant('{reg:HKCU\{cm:GameRegEng},InstallPath|{pf}\Diablo II}');
100+
101+
if (not FileExists(gamepath+ExpandConstant('\{cm:CheckFile}'))) then
102+
gamepath:=ExpandConstant('{pf}\Diablo II');
103+
104+
Result := gamepath;
105+
end;
106+
107+
function NextButtonClick(CurPage: Integer): Boolean;
108+
var
109+
ErrorCode: Integer;
110+
begin
111+
if (CurPage = wpSelectDir) then
112+
begin
113+
if (not FileExists(ExpandConstant('{app}\{cm:CheckFile}'))) then
114+
begin
115+
MsgBox(FmtMessage(ExpandConstant('{cm:GameNotFound}'), [WizardForm.DirEdit.Text]), mbConfirmation, MB_OK);
116+
Result:=false;
117+
end
118+
else Result:=true;
119+
end
120+
else result:=true;
121+
end;
122+
123+
function ChangeStatusLabel(AppName: String): Boolean;
124+
begin
125+
WizardForm.FilenameLabel.Caption := FmtMessage(ExpandConstant('{cm:InstallingApp}'), [AppName]);
126+
Result := true;
127+
end;
128+
129+
procedure InitializeWizard();
130+
begin
131+
//### hide unwanted stuff ###
132+
WizardForm.FinishedHeadingLabel.Visible := False;
133+
WizardForm.Bevel1.Visible := false;
134+
WizardForm.Bevel.Visible := false;
135+
WizardForm.MainPanel.Visible := false;
136+
WizardForm.SelectDirBitmapImage.Visible := False;
137+
WizardForm.SelectGroupBitmapImage.Visible := False;
138+
WizardForm.WizardSmallBitmapImage.Visible := false;
139+
WizardForm.WizardBitmapImage.Visible := false;
140+
WizardForm.SelectDirBrowseLabel.Visible := false;
141+
142+
//ISTheme();
143+
end;
144+
145+
procedure CurPageChanged(CurPageID: Integer);
146+
begin
147+
if (CurPageID = wpSelectDir) then
148+
begin
149+
WizardForm.SelectDirLabel.Caption := ExpandConstant('{cm:SelectDiablo2Folder}');
150+
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall);
151+
WizardForm.BackButton.Visible := false;
152+
end;
153+
end;
154+
155+
function InitializeSetup(): Boolean;
156+
begin
157+
Result := true;
158+
ExtractTemporaryFile('VC_redist.x86.exe');
159+
ExtractTemporaryFile('VC_redist.x64.exe');
160+
MsgBox(ExpandConstant('{cm:EnglishInstallRequired}'), mbConfirmation, MB_OK);
161+
end;

Resources/PD2_Icon.ico

135 KB
Binary file not shown.

0 commit comments

Comments
 (0)