Launcher: ensure DPI awareness on start; added GOG leftovers cleanup
This commit is contained in:
parent
c59ed9dcac
commit
f908181740
@ -250,6 +250,18 @@ Func WriteCheckboxWithCustom($ctrl, $section, $key, $checkedVal = "1", $unchecke
|
|||||||
EndIf
|
EndIf
|
||||||
EndFunc
|
EndFunc
|
||||||
|
|
||||||
|
; ============================================
|
||||||
|
; DPI Awareness Functions
|
||||||
|
; ============================================
|
||||||
|
Func SetDPIAwareness()
|
||||||
|
; Set DPI awareness for SkyrimSE.exe to prevent Windows scaling issues
|
||||||
|
Local $exePath = $LAUNCHER_DIR & "\SkyrimSE.exe"
|
||||||
|
If Not FileExists($exePath) Then Return
|
||||||
|
|
||||||
|
Local $regKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
|
||||||
|
RegWrite($regKey, $exePath, "REG_SZ", "~ HIGHDPIAWARE")
|
||||||
|
EndFunc
|
||||||
|
|
||||||
; ============================================
|
; ============================================
|
||||||
; Version Detection Functions
|
; Version Detection Functions
|
||||||
; ============================================
|
; ============================================
|
||||||
@ -314,12 +326,167 @@ Func GetEnderalVersion()
|
|||||||
Return ""
|
Return ""
|
||||||
EndFunc
|
EndFunc
|
||||||
|
|
||||||
|
; ============================================
|
||||||
|
; Update Function
|
||||||
|
; ============================================
|
||||||
|
Func CheckAndApplyUpdate()
|
||||||
|
; Check if update is needed: SkyrimSE.exe is not 1.6.659 AND skse64_1_6_659.dll exists
|
||||||
|
Local $skyrimVersion = GetSkyrimVersion()
|
||||||
|
Local $oldSkseDll = $LAUNCHER_DIR & "\skse64_1_6_659.dll"
|
||||||
|
|
||||||
|
If $skyrimVersion <> "1.6.659" And FileExists($oldSkseDll) Then
|
||||||
|
; Files to delete unconditionally
|
||||||
|
Local $filesToDelete[] = [ _
|
||||||
|
"skse64_1_6_659.dll", _
|
||||||
|
"tbb.dll", _
|
||||||
|
"tbbmalloc.dll", _
|
||||||
|
"enderal readme.txt", _
|
||||||
|
"Skyrim_Default.ini", _
|
||||||
|
"Data\Skyrim - Patch.bsa", _
|
||||||
|
"Data\Enderal SE v2.0.12.4 Changelog.txt", _
|
||||||
|
"Data\SKSE\Plugins\JContainers64.dll", _
|
||||||
|
"Data\SKSE\Plugins\YesImSure.json", _
|
||||||
|
"Data\meshes\actors\character\character assets\skeleton.xml", _
|
||||||
|
"Data\meshes\actors\character\character assets female\skeleton_female.xml", _
|
||||||
|
"Data\SkyUI_SE.ini" _
|
||||||
|
]
|
||||||
|
|
||||||
|
; Files to delete only if size matches [path, size]
|
||||||
|
Local $filesToDeleteWithSize[][2] = [ _
|
||||||
|
["Data\Interface\controls\pc\controlmap.txt", 8492], _
|
||||||
|
["Data\Interface\exported\widgets\skyui\followerpanel.swf", 15541], _
|
||||||
|
["Data\Interface\dialoguemenu.swf", 24622], _
|
||||||
|
["Data\Interface\fonts_en2.swf", 33021], _
|
||||||
|
["Data\Interface\hudmenu.swf", 372484], _
|
||||||
|
["Data\Interface\startmenu.swf", 66683], _
|
||||||
|
["Data\Interface\fontconfig.txt", 1211], _
|
||||||
|
["Data\Scripts\ActiveMagicEffect.pex", 7497], _
|
||||||
|
["Data\Scripts\Actor.pex", 14869], _
|
||||||
|
["Data\Scripts\ActorBase.pex", 2643], _
|
||||||
|
["Data\Scripts\ActorValueInfo.pex", 1791], _
|
||||||
|
["Data\Scripts\Alias.pex", 3949], _
|
||||||
|
["Data\Scripts\Ammo.pex", 549], _
|
||||||
|
["Data\Scripts\Apparatus.pex", 522], _
|
||||||
|
["Data\Scripts\Armor.pex", 4983], _
|
||||||
|
["Data\Scripts\ArmorAddon.pex", 1169], _
|
||||||
|
["Data\Scripts\Art.pex", 500], _
|
||||||
|
["Data\Scripts\Book.pex", 574], _
|
||||||
|
["Data\Scripts\Camera.pex", 1171], _
|
||||||
|
["Data\Scripts\Cell.pex", 1264], _
|
||||||
|
["Data\Scripts\ColorComponent.pex", 1206], _
|
||||||
|
["Data\Scripts\ColorForm.pex", 1124], _
|
||||||
|
["Data\Scripts\CombatStyle.pex", 3260], _
|
||||||
|
["Data\Scripts\ConstructibleObject.pex", 1047], _
|
||||||
|
["Data\Scripts\DefaultObjectManager.pex", 540], _
|
||||||
|
["Data\Scripts\Enchantment.pex", 1149], _
|
||||||
|
["Data\Scripts\EquipSlot.pex", 515], _
|
||||||
|
["Data\Scripts\Faction.pex", 3819], _
|
||||||
|
["Data\Scripts\Flora.pex", 651], _
|
||||||
|
["Data\Scripts\Form.pex", 5057], _
|
||||||
|
["Data\Scripts\FormList.pex", 813], _
|
||||||
|
["Data\Scripts\FormType.pex", 7963], _
|
||||||
|
["Data\Scripts\GameData.pex", 1898], _
|
||||||
|
["Data\Scripts\HeadPart.pex", 1274], _
|
||||||
|
["Data\Scripts\Ingredient.pex", 1369], _
|
||||||
|
["Data\Scripts\Input.pex", 968], _
|
||||||
|
["Data\Scripts\JArray.pex", 3575], _
|
||||||
|
["Data\Scripts\JAtomic.pex", 1973], _
|
||||||
|
["Data\Scripts\JContainers.pex", 1184], _
|
||||||
|
["Data\Scripts\JContainers_DomainExample.pex", 14101], _
|
||||||
|
["Data\Scripts\JDB.pex", 1373], _
|
||||||
|
["Data\Scripts\JFormDB.pex", 1933], _
|
||||||
|
["Data\Scripts\JFormMap.pex", 1675], _
|
||||||
|
["Data\Scripts\JIntMap.pex", 1672], _
|
||||||
|
["Data\Scripts\JLua.pex", 1162], _
|
||||||
|
["Data\Scripts\JMap.pex", 1669], _
|
||||||
|
["Data\Scripts\JString.pex", 944], _
|
||||||
|
["Data\Scripts\JValue.pex", 2589], _
|
||||||
|
["Data\Scripts\Keyword.pex", 714], _
|
||||||
|
["Data\Scripts\LeveledActor.pex", 805], _
|
||||||
|
["Data\Scripts\LeveledItem.pex", 1022], _
|
||||||
|
["Data\Scripts\LeveledSpell.pex", 802], _
|
||||||
|
["Data\Scripts\Location.pex", 1744], _
|
||||||
|
["Data\Scripts\MagicEffect.pex", 2501], _
|
||||||
|
["Data\Scripts\Math.pex", 1436], _
|
||||||
|
["Data\Scripts\ModEvent.pex", 952], _
|
||||||
|
["Data\Scripts\NetImmerse.pex", 2929], _
|
||||||
|
["Data\Scripts\ObjectReference.pex", 16307], _
|
||||||
|
["Data\Scripts\Outfit.pex", 505], _
|
||||||
|
["Data\Scripts\Perk.pex", 1431], _
|
||||||
|
["Data\Scripts\Potion.pex", 1298], _
|
||||||
|
["Data\Scripts\Quest.pex", 5314], _
|
||||||
|
["Data\Scripts\Race.pex", 6618], _
|
||||||
|
["Data\Scripts\Scroll.pex", 1387], _
|
||||||
|
["Data\Scripts\Shout.pex", 766], _
|
||||||
|
["Data\Scripts\SKSE.pex", 845], _
|
||||||
|
["Data\Scripts\SoulGem.pex", 506], _
|
||||||
|
["Data\Scripts\Sound.pex", 723], _
|
||||||
|
["Data\Scripts\SoundDescriptor.pex", 900], _
|
||||||
|
["Data\Scripts\SpawnerTask.pex", 907], _
|
||||||
|
["Data\Scripts\Spell.pex", 1673], _
|
||||||
|
["Data\Scripts\StringUtil.pex", 1100], _
|
||||||
|
["Data\Scripts\TextureSet.pex", 593], _
|
||||||
|
["Data\Scripts\TreeObject.pex", 650], _
|
||||||
|
["Data\Scripts\UI.pex", 2070], _
|
||||||
|
["Data\Scripts\UICallback.pex", 1139], _
|
||||||
|
["Data\Scripts\Utility.pex", 2658], _
|
||||||
|
["Data\Scripts\Weapon.pex", 3259], _
|
||||||
|
["Data\Scripts\Weather.pex", 1107], _
|
||||||
|
["Data\Scripts\WornObject.pex", 1629] _
|
||||||
|
]
|
||||||
|
|
||||||
|
; Delete unconditional files
|
||||||
|
For $i = 0 To UBound($filesToDelete) - 1
|
||||||
|
Local $fullPath = $LAUNCHER_DIR & "\" & $filesToDelete[$i]
|
||||||
|
If FileExists($fullPath) Then
|
||||||
|
FileDelete($fullPath)
|
||||||
|
EndIf
|
||||||
|
Next
|
||||||
|
|
||||||
|
; Delete files only if size matches
|
||||||
|
For $i = 0 To UBound($filesToDeleteWithSize) - 1
|
||||||
|
Local $fullPath = $LAUNCHER_DIR & "\" & $filesToDeleteWithSize[$i][0]
|
||||||
|
If FileExists($fullPath) Then
|
||||||
|
Local $fileSize = FileGetSize($fullPath)
|
||||||
|
If $fileSize = $filesToDeleteWithSize[$i][1] Then
|
||||||
|
FileDelete($fullPath)
|
||||||
|
EndIf
|
||||||
|
EndIf
|
||||||
|
Next
|
||||||
|
|
||||||
|
; Delete directories
|
||||||
|
Local $dirsToDelete[] = [ _
|
||||||
|
"Data\SKSE\Plugins\JCData", _
|
||||||
|
"Skyrim" _
|
||||||
|
]
|
||||||
|
|
||||||
|
For $i = 0 To UBound($dirsToDelete) - 1
|
||||||
|
Local $fullPath = $LAUNCHER_DIR & "\" & $dirsToDelete[$i]
|
||||||
|
If FileExists($fullPath) Then
|
||||||
|
DirRemove($fullPath, 1)
|
||||||
|
EndIf
|
||||||
|
Next
|
||||||
|
|
||||||
|
; Set borderless windowed mode in EnderalPrefs.ini if it exists
|
||||||
|
Local $prefsPath = GetDocumentsPath() & "\My Games\" & GetEnderalBaseDirectoryName() & "\EnderalPrefs.ini"
|
||||||
|
If FileExists($prefsPath) Then
|
||||||
|
IniWrite($prefsPath, "Display", "bBorderless", "1")
|
||||||
|
IniWrite($prefsPath, "Display", "bFull Screen", "0")
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
MsgBox(64, "Update", "Enderal SE has been successfully updated.")
|
||||||
|
EndIf
|
||||||
|
EndFunc
|
||||||
|
|
||||||
; ============================================
|
; ============================================
|
||||||
; Main Entry Point
|
; Main Entry Point
|
||||||
; ============================================
|
; ============================================
|
||||||
Main()
|
Main()
|
||||||
|
|
||||||
Func Main()
|
Func Main()
|
||||||
|
; Check and apply update if needed
|
||||||
|
CheckAndApplyUpdate()
|
||||||
|
|
||||||
; Check if SkyrimRedirector is installed
|
; Check if SkyrimRedirector is installed
|
||||||
Local $redirectorDll = $LAUNCHER_DIR & "\Data\SKSE\Plugins\SkyrimRedirector.dll"
|
Local $redirectorDll = $LAUNCHER_DIR & "\Data\SKSE\Plugins\SkyrimRedirector.dll"
|
||||||
Local $redirectorIni = $LAUNCHER_DIR & "\Data\SKSE\Plugins\SkyrimRedirector.ini"
|
Local $redirectorIni = $LAUNCHER_DIR & "\Data\SKSE\Plugins\SkyrimRedirector.ini"
|
||||||
@ -671,27 +838,27 @@ Func CreateMainWindow()
|
|||||||
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
||||||
GUICtrlSetCursor(-1, 0)
|
GUICtrlSetCursor(-1, 0)
|
||||||
|
|
||||||
; Support - shadow first, then main label
|
; Discord - shadow first, then main label
|
||||||
$lblSupportShadow = GUICtrlCreateLabel("Support", $startX + $linkSpacing * 2 + 1, $linkBarY + 1, 70, 25, $SS_CENTER)
|
$lblSupportShadow = GUICtrlCreateLabel("Discord", $startX + $linkSpacing * 2 + 1, $linkBarY + 1, 70, 25, $SS_CENTER)
|
||||||
GUICtrlSetFont(-1, 10, 400, 4)
|
GUICtrlSetFont(-1, 10, 400, 4)
|
||||||
GUICtrlSetColor(-1, 0x000000)
|
GUICtrlSetColor(-1, 0x000000)
|
||||||
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
||||||
GUICtrlSetCursor(-1, 0)
|
GUICtrlSetCursor(-1, 0)
|
||||||
|
|
||||||
$lblSupport = GUICtrlCreateLabel("Support", $startX + $linkSpacing * 2, $linkBarY, 70, 25, $SS_CENTER)
|
$lblSupport = GUICtrlCreateLabel("Discord", $startX + $linkSpacing * 2, $linkBarY, 70, 25, $SS_CENTER)
|
||||||
GUICtrlSetFont(-1, 10, 400, 4)
|
GUICtrlSetFont(-1, 10, 400, 4)
|
||||||
GUICtrlSetColor(-1, 0xFFFFFF)
|
GUICtrlSetColor(-1, 0xFFFFFF)
|
||||||
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
||||||
GUICtrlSetCursor(-1, 0)
|
GUICtrlSetCursor(-1, 0)
|
||||||
|
|
||||||
; Changelog - shadow first, then main label
|
; Changelog - shadow first, then main label
|
||||||
$lblChangelogShadow = GUICtrlCreateLabel("Changelog", $startX + $linkSpacing * 3 + 15 + 1, $linkBarY + 1, 100, 25, $SS_CENTER)
|
$lblChangelogShadow = GUICtrlCreateLabel("Changelog", $startX + $linkSpacing * 3 + 9 + 1, $linkBarY + 1, 100, 25, $SS_CENTER)
|
||||||
GUICtrlSetFont(-1, 10, 400, 4)
|
GUICtrlSetFont(-1, 10, 400, 4)
|
||||||
GUICtrlSetColor(-1, 0x000000)
|
GUICtrlSetColor(-1, 0x000000)
|
||||||
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
||||||
GUICtrlSetCursor(-1, 0)
|
GUICtrlSetCursor(-1, 0)
|
||||||
|
|
||||||
$lblChangelog = GUICtrlCreateLabel("Changelog", $startX + $linkSpacing * 3 + 15, $linkBarY, 100, 25, $SS_CENTER)
|
$lblChangelog = GUICtrlCreateLabel("Changelog", $startX + $linkSpacing * 3 + 9, $linkBarY, 100, 25, $SS_CENTER)
|
||||||
GUICtrlSetFont(-1, 10, 400, 4)
|
GUICtrlSetFont(-1, 10, 400, 4)
|
||||||
GUICtrlSetColor(-1, 0xFFFFFF)
|
GUICtrlSetColor(-1, 0xFFFFFF)
|
||||||
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
||||||
@ -1101,7 +1268,7 @@ Func MainLoop()
|
|||||||
ShellExecute("https://wiki.en.sureai.net/Enderal")
|
ShellExecute("https://wiki.en.sureai.net/Enderal")
|
||||||
|
|
||||||
Case $lblSupport, $lblSupportShadow
|
Case $lblSupport, $lblSupportShadow
|
||||||
ShellExecute("https://mod.pub/enderal-se/38/comments")
|
ShellExecute("https://go.eddoursul.win/enderal-se-launcher-support")
|
||||||
|
|
||||||
Case $lblChangelog, $lblChangelogShadow
|
Case $lblChangelog, $lblChangelogShadow
|
||||||
ShellExecute("https://mod.pub/enderal-se/38/changelogs")
|
ShellExecute("https://mod.pub/enderal-se/38/changelogs")
|
||||||
@ -1418,24 +1585,21 @@ Func LaunchGame()
|
|||||||
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
|
||||||
GUISetState(@SW_SHOW, $hLaunchingGUI)
|
GUISetState(@SW_SHOW, $hLaunchingGUI)
|
||||||
|
|
||||||
|
; Set DPI awareness for SkyrimSE.exe
|
||||||
|
SetDPIAwareness()
|
||||||
|
|
||||||
; Launch SKSE
|
; Launch SKSE
|
||||||
Run($LAUNCHER_DIR & "\skse64_loader.exe", $LAUNCHER_DIR)
|
Run($LAUNCHER_DIR & "\skse64_loader.exe", $LAUNCHER_DIR)
|
||||||
|
|
||||||
; Wait for SkyrimSE.exe to gain focus
|
; Wait for SkyrimSE.exe window to appear (GOG or Steam version)
|
||||||
Local $hSkyrimWnd = 0
|
|
||||||
While 1
|
While 1
|
||||||
; Check if SkyrimSE.exe window exists and has focus
|
If WinExists("[CLASS:Skyrim Special Edition GOG]") Or WinExists("[CLASS:Skyrim Special Edition]") Then
|
||||||
$hSkyrimWnd = WinGetHandle("[CLASS:Skyrim Special Edition]")
|
ExitLoop
|
||||||
If $hSkyrimWnd Then
|
|
||||||
; SkyrimSE window exists, check if it has focus
|
|
||||||
If WinActive($hSkyrimWnd) Then
|
|
||||||
ExitLoop
|
|
||||||
EndIf
|
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
; Also check if the process is no longer running (user closed it quickly)
|
; Also check if the process is no longer running (user closed it quickly)
|
||||||
If Not ProcessExists("SkyrimSE.exe") And Not ProcessExists("skse64_loader.exe") Then
|
If Not ProcessExists("SkyrimSE.exe") And Not ProcessExists("skse64_loader.exe") Then
|
||||||
; Process ended before gaining focus, close modal and restore buttons
|
; Process ended before window appeared, close modal and restore buttons
|
||||||
GUIDelete($hLaunchingGUI)
|
GUIDelete($hLaunchingGUI)
|
||||||
GUICtrlSetState($btnPlay, $GUI_SHOW)
|
GUICtrlSetState($btnPlay, $GUI_SHOW)
|
||||||
GUICtrlSetState($btnSettings, $GUI_SHOW)
|
GUICtrlSetState($btnSettings, $GUI_SHOW)
|
||||||
@ -1446,7 +1610,7 @@ Func LaunchGame()
|
|||||||
Sleep(100)
|
Sleep(100)
|
||||||
WEnd
|
WEnd
|
||||||
|
|
||||||
; SkyrimSE.exe has focus, exit launcher
|
; SkyrimSE.exe window exists, exit launcher
|
||||||
Exit
|
Exit
|
||||||
EndFunc
|
EndFunc
|
||||||
|
|
||||||
|
|||||||
@ -59,21 +59,26 @@ bUseWaterDepth=1
|
|||||||
bUseWaterDisplacements=1
|
bUseWaterDisplacements=1
|
||||||
bUseWaterReflections=1
|
bUseWaterReflections=1
|
||||||
bUseWaterRefractions=1
|
bUseWaterRefractions=1
|
||||||
|
|
||||||
[MapMenu]
|
[MapMenu]
|
||||||
uLockedObjectMapLOD = 32
|
; Paper map settings
|
||||||
uLockedTerrainLOD = 32
|
uLockedObjectMapLOD=32
|
||||||
sWorldMapOverlayNormalSnowTexture =
|
uLockedTerrainLOD=32
|
||||||
sWorldMapOverlayNormalTexture =
|
sWorldMapOverlayNormalSnowTexture=
|
||||||
sMapCloudNIF = 0
|
sWorldMapOverlayNormalTexture=
|
||||||
fWorldMapDepthBlurScale = 0.0000
|
sMapCloudNIF=0
|
||||||
fMapWorldMaxPanSpeed = 80000.0000
|
fWorldMapDepthBlurScale=0.0000
|
||||||
fMapWorldCursorMoveArea = 0.4000
|
fMapWorldMaxPanSpeed=80000.0000
|
||||||
fMapWorldYawRange = 20.0000
|
fMapWorldCursorMoveArea=0.4000
|
||||||
fMapWorldMinPitch = 90.0000
|
fMapWorldYawRange=20.0000
|
||||||
fMapWorldMaxPitch = 90.0000
|
fMapWorldMinPitch=90.0000
|
||||||
sMapWorldDefaultWorldSpace = Vyn
|
fMapWorldMaxPitch=90.0000
|
||||||
|
sMapWorldDefaultWorldSpace=Vyn
|
||||||
|
fMapTransitionSpeed=0.4
|
||||||
|
|
||||||
[SaveGame]
|
[SaveGame]
|
||||||
iAutoSaveCount=5
|
iAutoSaveCount=5
|
||||||
|
|
||||||
[Interface]
|
[Interface]
|
||||||
fBookDistance=75.0000
|
fBookDistance=75.0000
|
||||||
fNoteDistance=70.0000
|
fNoteDistance=70.0000
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user