Skip to content

Commit

Permalink
installer support reverting OpenGL2 renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
Die4Ever committed Sep 7, 2023
1 parent cee2f0f commit 68c4c3a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions installer/GUI/InstallerWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def _Install(self):
'exetype': v.get('exe', dummy).get(),
'mirrors': v.get('mirrors', dummy).get(),
'LDDP': v.get('LDDP', dummy).get(),
'OpenGL2': v.get('OpenGL2', dummy).get(),
'downloadcallback': self.DownloadProgress,
}

Expand Down
18 changes: 13 additions & 5 deletions installer/Install/Install.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,20 @@ def InstallVanilla(system:Path, settings:dict, speedupfix:bool):
CopyPackageFiles('vanilla', gameroot, ['DeusEx.u'])
CopyD3DRenderers(system)

Ogl = system/'OpenGLDrv.dll'
backupOgl = system/'OpenGLDrv.orig.dll'
if settings.get('OpenGL2'):
dest = system/'OpenGLDrv.dll'
backup = system/'OpenGLDrv.orig.dll'
if dest.exists() and not backup.exists():
dest.rename(backup)
CopyTo(GetSourcePath() / '3rdParty' /'OpenGLDrv.dll', dest)
if Ogl.exists() and not backupOgl.exists():
Ogl.rename(backupOgl)
CopyTo(GetSourcePath() / '3rdParty' /'OpenGLDrv.dll', Ogl)
elif backupOgl.exists():
currMd5 = ''
if Ogl.exists():
currMd5 = MD5(Ogl.read_bytes())
backupMd5 = MD5(backupOgl.read_bytes())
info('reverting', Ogl, currMd5, 'to', backupOgl, backupMd5)
CopyTo(backupOgl, Ogl)


FemJCu = GetSourcePath() / '3rdParty' / "FemJC.u"
CopyTo(FemJCu, dxrroot / 'System' / 'FemJC.u')
Expand Down

0 comments on commit 68c4c3a

Please sign in to comment.