Skip to content

Commit 75e0d13

Browse files
committed
Add support for 1.7
1 parent 770cb96 commit 75e0d13

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

include/Diag.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include "Common.h"
1818

19-
#define CUR_MTA_VERSIONS 6 // beginning at 1; encompasses 1.1, 1.2, 1.3, 1.4, 1.5, 1.6
19+
#define CUR_MTA_VERSIONS 7 // beginning at 1; encompasses 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7
2020

2121
// MTA install path
2222
#define MTAPathValue "Last Install Location"
@@ -26,6 +26,7 @@
2626
#define MTA14PathSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.4"
2727
#define MTA15PathSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.5"
2828
#define MTA16PathSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.6"
29+
#define MTA17PathSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.7"
2930

3031
// GTA:SA path
3132
#define MTAGTAPathValue "GTA:SA Path"
@@ -39,6 +40,7 @@
3940
#define MTA14VerSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.4\\Settings\\general"
4041
#define MTA15VerSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.5\\Settings\\general"
4142
#define MTA16VerSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.6\\Settings\\general"
43+
#define MTA17VerSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.7\\Settings\\general"
4244

4345
// Nightly download URLs
4446
#define MTA11NightlyURL "https://nightly.mtasa.com/?mtasa-1.1.1-rc-latest"
@@ -47,6 +49,7 @@
4749
#define MTA14NightlyURL "https://nightly.mtasa.com/?mtasa-1.4.1-rc-latest"
4850
#define MTA15NightlyURL "https://nightly.mtasa.com/?mtasa-1.5-rc-latest"
4951
#define MTA16NightlyURL "https://nightly.mtasa.com/?mtasa-1.6-rc-latest"
52+
#define MTA17NightlyURL "https://nightly.mtasa.com/?mtasa-1.7-rc-latest"
5053

5154
#define MTAVerURL "https://nightly.mtasa.com/ver/"
5255

src/Diag.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ bool Diag::PollMTAVersions ( void )
401401
MTAVersionsInstalled[4] = ReadRegKey ( MTAPathValue, MTA14PathSubKey ); // store MTA 1.4 path, if present
402402
MTAVersionsInstalled[5] = ReadRegKey ( MTAPathValue, MTA15PathSubKey ); // store MTA 1.5 path, if present
403403
MTAVersionsInstalled[6] = ReadRegKey ( MTAPathValue, MTA16PathSubKey ); // store MTA 1.6 path, if present
404+
MTAVersionsInstalled[7] = ReadRegKey ( MTAPathValue, MTA17PathSubKey ); // store MTA 1.7 path, if present
404405

405406
// if a version isn't installed, "Failed to get key." is returned by ReadRegKey; clear that array element
406407
for ( int i = 1; i <= CUR_MTA_VERSIONS; i++ )
@@ -495,6 +496,10 @@ std::string Diag::GetMTAPath ( void )
495496
MTAPath = ReadRegKey ( MTAPathValue, MTA16PathSubKey );
496497
return MTAPath;
497498
break;
499+
case 7:
500+
MTAPath = ReadRegKey ( MTAPathValue, MTA17PathSubKey );
501+
return MTAPath;
502+
break;
498503
}
499504
return "Unable to read MTA path.";
500505
}
@@ -533,6 +538,11 @@ std::string Diag::GetMTAVersion ( void )
533538
MTAShortVersion = "1.6";
534539
return MTAVersion;
535540
break;
541+
case 7:
542+
MTAVersion = ReadRegKey ( MTAVerValue, MTA17VerSubKey );
543+
MTAShortVersion = "1.7";
544+
return MTAVersion;
545+
break;
536546
}
537547
return "Unable to read MTA version.";
538548
}
@@ -571,6 +581,9 @@ void Diag::UpdateMTA ( void )
571581
case 6:
572582
url = MTA16NightlyURL;
573583
break;
584+
case 7:
585+
url = MTA17NightlyURL;
586+
break;
574587
}
575588

576589
#ifndef SKIPUPDATE

0 commit comments

Comments
 (0)