Skip to content

Commit 0c82c02

Browse files
authored
QModManager 2.1 RELEASE (#92)
2 parents b73c0eb + ddca145 commit 0c82c02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+12146
-448
lines changed

.gitignore

-11
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,6 @@
33
##
44
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
55

6-
assemblies/0Harmony.dll
7-
assemblies/Assembly-CSharp.dll
8-
assemblies/UnityEngine.dll
9-
assemblies/UnityEngine.UI.dll
10-
assemblies/Newtonsoft.Json.dll
11-
assemblies/Mono.Cecil.dll
12-
assemblies/Mono.Cecil.Mdb.dll
13-
assemblies/Mono.Cecil.Pdb.dll
14-
assemblies/Mono.Cecil.Rocks.dll
15-
assemblies/QModInstaller.dll
16-
176
# User-specific files
187
*.suo
198
*.user

Build/InstallerExtensions.dll

0 Bytes
Binary file not shown.

Build/QModInstaller.dll

8.5 KB
Binary file not shown.

Build/QModInstaller.xml

+653
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Build/QModManager.exe

0 Bytes
Binary file not shown.

Build/QModManager_Setup.exe

-871 KB
Binary file not shown.

Data/latest-version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.1
1+
2.1

Dependencies/README.md

+18-24
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
### Normal Dependencies
2-
These files are required and will be redistributed with QModManager
3-
- `0Harmony.dll` & `0Harmony-1.2.0.1.dll`: https://github.com/pardeike/Harmony
1+
## Dependencies
42

5-
---
6-
7-
### Game Dependencies
8-
These files are required, but are from the base game and will not be redistributed with QModManager
9-
- `Assembly-CSharp.dll` & `Assembly-CSharp-firstpass.dll`: https://github.com/unknownworlds
10-
- `Newtonsoft.JSON.dll`: https://github.com/JamesNK/Newtonsoft.Json
11-
- `UnityEngine.dll` & `UnityEngine.UI.dll`: https://github.com/Unity-Technologies/UnityCsReference
12-
13-
---
14-
15-
### Injector Dependencies
16-
These files are required by the injector and will be redistributed with QModManager
17-
- `AssetsTools.NET`: https://github.com/nesrak1/AssetsTools.NET
18-
- `cldb.dat` & `cldb2018.dat`: https://github.com/DerPopo/UABE
19-
- `Mono.Cecil.dll`: https://github.com/jbevain/cecil
20-
21-
---
22-
23-
### Installer Dependencies
24-
These files are required by the installer, but will not be redistributed with QModManager
25-
- `Carbon.vsf` & `VclStylesinno.dll`: https://github.com/RRUZ/vcl-styles-plugins
3+
| Dependency | Link | Redistributed |
4+
|:-------------------------------:|:------------------------------------------------------:|:----------------------------------------:|
5+
| `0Harmony.dll` | https://github.com/pardeike/Harmony | ☑ |
6+
| `0Harmony-1.2.0.1.dll` | https://github.com/pardeike/Harmony | ☑ |
7+
| `Assembly-CSharp.dll` | https://github.com/unknownworlds | &#9744; <br>Game file |
8+
| `Assembly-CSharp-firstpass.dll` | https://github.com/unknownworlds | &#9744; <br>Game file |
9+
| `AssetsTools.NET.dll` | https://github.com/nesrak1/AssetsTools.NET | &#9745; |
10+
| `Carbon.vsf` | https://github.com/RRUZ/vcl-styles-plugins | &#9744; <br>Bundled with the installer |
11+
| `cldb.dat` | https://github.com/DerPopo/UABE | &#9745; <br>Only for Subnautica installs |
12+
| `cldb2018.dat` | https://github.com/DerPopo/UABE | &#9745; <br>Only for Below Zero installs |
13+
| `Mono.Cecil.dll` | https://github.com/jbevain/cecil | &#9745; |
14+
| `Netwonsoft.Json.dll` | https://github.com/JamesNK/Newtonsoft.Json | &#9744; <br>Game file |
15+
| `RGiesecke.DllExport.Metadata.dll` | https://www.nuget.org/packages/UnmanagedExports | &#9744; |
16+
| `SemVer.dll` | https://github.com/adamreeve/semver.net | &#9745; |
17+
| `UnityEngine.dll` | https://github.com/Unity-Technologies/UnityCsReference | &#9744; <br>Game file |
18+
| `UnityEngine.UI.dll` | https://github.com/Unity-Technologies/UnityCsReference | &#9744; <br>Game file |
19+
| `VclStylesinno.dll` | https://github.com/RRUZ/vcl-styles-plugins | &#9744; <br>Bundled with the installer |

Dependencies/SemVer.dll

31 KB
Binary file not shown.

Executable/Injector.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ namespace QModManager
88
{
99
internal class Injector
1010
{
11-
private readonly string gameDirectory;
12-
private readonly string managedDirectory;
13-
private readonly string globalgamemanagers;
14-
private readonly string mainFilename = "Assembly-CSharp.dll";
15-
private const string installerFilename = "QModInstaller.dll";
11+
internal readonly string gameDirectory;
12+
internal readonly string managedDirectory;
13+
internal readonly string globalgamemanagers;
14+
internal readonly string mainFilename = "Assembly-CSharp.dll";
15+
internal const string installerFilename = "QModInstaller.dll";
1616

1717
internal Injector(string dir, string managedDir)
1818
{

Executable/Program.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ internal static void Main(string[] args)
4747
string managedDirectory = Environment.CurrentDirectory;
4848
string globalgamemanagers = Path.Combine(managedDirectory, "../globalgamemanagers");
4949

50-
if (!File.Exists(managedDirectory + "/Assembly-CSharp.dll"))
50+
if (!File.Exists(Path.Combine(managedDirectory, "Assembly-CSharp.dll")))
5151
{
5252
Console.WriteLine("Could not find the assembly file.");
5353
Console.WriteLine("Please make sure you have installed QModManager in the right folder.");
@@ -262,11 +262,11 @@ internal static void DisableExit()
262262
Console.TreatControlCAsInput = true;
263263
}
264264

265-
private static void DisableExitButton() => EnableMenuItem(GetSystemMenu(GetConsoleWindow(), false), 0xF060, 0x1);
266-
private static void CancelKeyPress(object sender, ConsoleCancelEventArgs e) => e.Cancel = true;
267-
[DllImport("user32.dll")] private static extern int EnableMenuItem(IntPtr tMenu, int targetItem, int targetStatus);
268-
[DllImport("user32.dll")] private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
269-
[DllImport("kernel32.dll", ExactSpelling = true)] private static extern IntPtr GetConsoleWindow();
265+
internal static void DisableExitButton() => EnableMenuItem(GetSystemMenu(GetConsoleWindow(), false), 0xF060, 0x1);
266+
internal static void CancelKeyPress(object sender, ConsoleCancelEventArgs e) => e.Cancel = true;
267+
[DllImport("user32.dll")] internal static extern int EnableMenuItem(IntPtr tMenu, int targetItem, int targetStatus);
268+
[DllImport("user32.dll")] internal static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
269+
[DllImport("kernel32.dll", ExactSpelling = true)] internal static extern IntPtr GetConsoleWindow();
270270

271271
#endregion
272272
}

Executable/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
[assembly: ComVisible(false)]
1414

15-
[assembly: AssemblyVersion("2.0.1")]
16-
[assembly: AssemblyFileVersion("2.0.1")]
15+
[assembly: AssemblyVersion("2.1")]
16+
[assembly: AssemblyFileVersion("2.1")]

Installer/InstallerExtensions.dll

-5.5 KB
Binary file not shown.

Installer/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414

1515
[assembly: Guid("8c6c9a0b-80c4-43d2-89f2-749e6f09fdda")]
1616

17-
[assembly: AssemblyVersion("2.0.1")]
18-
[assembly: AssemblyFileVersion("2.0.1")]
17+
[assembly: AssemblyVersion("2.1")]
18+
[assembly: AssemblyFileVersion("2.1")]

Installer/QModsInstallerScript.iss

+99-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#endif
66

77
#define Name "QModManager" ; The name of the game will be added after it
8-
#define Version "2.0.1"
8+
#define Version "2.1"
99
#define Author "the QModManager dev team"
1010
#define URL "https://github.com/QModManager/QModManager"
1111
#define SupportURL "https://discord.gg/UpWuWwq"
@@ -64,7 +64,9 @@ Source: "..\Dependencies\0Harmony-1.2.0.1.dll"; DestDir: "{app}\Subnautica_Data\
6464
Source: "..\Dependencies\AssetsTools.NET.dll"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
6565
Source: "..\Dependencies\cldb.dat"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
6666
Source: "..\Dependencies\Mono.Cecil.dll"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
67+
Source: "..\Dependencies\SemVer.dll"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
6768
Source: "..\Build\QModInstaller.dll"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
69+
Source: "..\Build\QModInstaller.xml"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
6870
Source: "..\Build\QModManager.exe"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
6971
Source: "..\Assets\QModManagerAssets.unity3d"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
7072
; Below Zero
@@ -73,7 +75,9 @@ Source: "..\Dependencies\0Harmony-1.2.0.1.dll"; DestDir: "{app}\SubnauticaZero_D
7375
Source: "..\Dependencies\AssetsTools.NET.dll"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
7476
Source: "..\Dependencies\cldb2018.dat"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
7577
Source: "..\Dependencies\Mono.Cecil.dll"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
78+
Source: "..\Dependencies\SemVer.dll"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
7679
Source: "..\Build\QModInstaller.dll"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
80+
Source: "..\Build\QModInstaller.xml"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
7781
Source: "..\Build\QModManager.exe"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
7882
Source: "..\Assets\QModManagerAssets.unity3d"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
7983

@@ -111,7 +115,7 @@ Name: "qmm\bz"; Description: "Install for Below Zero"; Flags: exclusive fixed
111115

112116
[Code]
113117
// Import stuff from InstallerExtensions.dll
114-
function PathsEqual(pathone, pathtwo: WideString): Boolean; external 'PathsEqual@files:InstallerExtensions.dll stdcall';
118+
function PathsEqual(pathone, pathtwo: WideString): Boolean; external 'PathsEqual@files:InstallerExtensions.dll stdcall delayload';
115119
116120
function IsSubnautica(path: String): Boolean;
117121
begin
@@ -157,7 +161,7 @@ begin
157161
end
158162
else if (IsBelowZeroApp()) then
159163
begin
160-
Result := '{#Name} (Below zero)'
164+
Result := '{#Name} (Below Zero)'
161165
end
162166
else
163167
begin
@@ -457,8 +461,99 @@ end;
457461
procedure LoadVCLStyle(VClStyleFile: String); external 'LoadVCLStyleW@files:VclStylesInno.dll stdcall';
458462
procedure UnLoadVCLStyles; external 'UnLoadVCLStyles@files:VclStylesInno.dll stdcall';
459463
464+
// Check for .NET version -- code from http://www.kynosarges.de/DotNetVersion.html
465+
function IsDotNetDetected(version: string; service: cardinal): boolean;
466+
// Indicates whether the specified version and service pack of the .NET Framework is installed.
467+
//
468+
// version -- Specify one of these strings for the required .NET Framework version:
469+
// 'v1.1' .NET Framework 1.1
470+
// 'v2.0' .NET Framework 2.0
471+
// 'v3.0' .NET Framework 3.0
472+
// 'v3.5' .NET Framework 3.5
473+
// 'v4\Client' .NET Framework 4.0 Client Profile
474+
// 'v4\Full' .NET Framework 4.0 Full Installation
475+
// 'v4.5' .NET Framework 4.5
476+
// 'v4.5.1' .NET Framework 4.5.1
477+
// 'v4.5.2' .NET Framework 4.5.2
478+
// 'v4.6' .NET Framework 4.6
479+
// 'v4.6.1' .NET Framework 4.6.1
480+
// 'v4.6.2' .NET Framework 4.6.2
481+
// 'v4.7' .NET Framework 4.7
482+
//
483+
// service -- Specify any non-negative integer for the required service pack level:
484+
// 0 No service packs required
485+
// 1, 2, etc. Service pack 1, 2, etc. required
486+
var
487+
key, versionKey: string;
488+
install, release, serviceCount, versionRelease: cardinal;
489+
success: boolean;
490+
begin
491+
versionKey := version;
492+
versionRelease := 0;
493+
494+
// .NET 1.1 and 2.0 embed release number in version key
495+
if version = 'v1.1' then begin
496+
versionKey := 'v1.1.4322';
497+
end else if version = 'v2.0' then begin
498+
versionKey := 'v2.0.50727';
499+
end
500+
501+
// .NET 4.5 and newer install as update to .NET 4.0 Full
502+
else if Pos('v4.', version) = 1 then begin
503+
versionKey := 'v4\Full';
504+
case version of
505+
'v4.5': versionRelease := 378389;
506+
'v4.5.1': versionRelease := 378675; // 378758 on Windows 8 and older
507+
'v4.5.2': versionRelease := 379893;
508+
'v4.6': versionRelease := 393295; // 393297 on Windows 8.1 and older
509+
'v4.6.1': versionRelease := 394254; // 394271 before Win10 November Update
510+
'v4.6.2': versionRelease := 394802; // 394806 before Win10 Anniversary Update
511+
'v4.7': versionRelease := 460798; // 460805 before Win10 Creators Update
512+
end;
513+
end;
514+
515+
// installation key group for all .NET versions
516+
key := 'SOFTWARE\Microsoft\NET Framework Setup\NDP\' + versionKey;
517+
518+
// .NET 3.0 uses value InstallSuccess in subkey Setup
519+
if Pos('v3.0', version) = 1 then begin
520+
success := RegQueryDWordValue(HKLM, key + '\Setup', 'InstallSuccess', install);
521+
end else begin
522+
success := RegQueryDWordValue(HKLM, key, 'Install', install);
523+
end;
524+
525+
// .NET 4.0 and newer use value Servicing instead of SP
526+
if Pos('v4', version) = 1 then begin
527+
success := success and RegQueryDWordValue(HKLM, key, 'Servicing', serviceCount);
528+
end else begin
529+
success := success and RegQueryDWordValue(HKLM, key, 'SP', serviceCount);
530+
end;
531+
532+
// .NET 4.5 and newer use additional value Release
533+
if versionRelease > 0 then begin
534+
success := success and RegQueryDWordValue(HKLM, key, 'Release', release);
535+
success := success and (release >= versionRelease);
536+
end;
537+
538+
result := success and (install = 1) and (serviceCount >= service);
539+
end;
540+
460541
function InitializeSetup(): Boolean;
542+
var
543+
ErrCode: Integer;
461544
begin
545+
if not IsDotNetDetected('v3.5', 0) then
546+
begin
547+
if MsgBox('QModManager requires Microsoft .NET Framework 3.5.' + #13#10 + 'Would you like to install it now?', mbCriticalError, MB_YESNO) = IDYES then
548+
begin
549+
if not ShellExec('open', 'https://docs.microsoft.com/en-us/dotnet/framework/install/dotnet-35-windows-10', '', '', SW_SHOW, ewNoWait, ErrCode) then
550+
begin
551+
SysErrorMessage(ErrCode);
552+
end
553+
end;
554+
result := false;
555+
Exit
556+
end;
462557
appIsSet := false
463558
if IsAppRunning('Subnautica.exe') or IsAppRunning('SubnauticaZero.exe') then
464559
begin
@@ -524,4 +619,4 @@ procedure DeinitializeSetup();
524619
begin
525620
// Unload skin
526621
UnLoadVCLStyles;
527-
end;
622+
end;

Mac Installation/0Harmony.dll

-72 KB
Binary file not shown.

Mac Installation/Info.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Welcome to the QModManager installer!
2+
3+
This will install QModManager v2.1 on your computer.
4+
5+
Please close Subnautica and Subnautica: Below Zero before installing!
6+
7+
Click Next to continue, or click Cancel to exit the installer.

Mac Installation/Mono.Cecil.dll

-263 KB
Binary file not shown.

Mac Installation/QModInstaller.dll

-11.5 KB
Binary file not shown.

Mac Installation/QModManager.exe

-9 KB
Binary file not shown.

Mac Installation/QModsInstaller.pkg

28.5 MB
Binary file not shown.

0 commit comments

Comments
 (0)