Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Announcements
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 4 votes, 4.00 average. Display Modes
  #1  
Old 03-12-2016, 11:04 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Windows 10 Graal Editor Workaround

Due to changes Microsoft made to system files compatibility between GraalEditor.exe and Windows 10 was broken.

After some playing around I found it was possible to work-around the changes and stop GraalEditor from loading the wrong DLLs (d2d1.dll, d3d11.dll, iertutil.dll) which cause the crash on startup and issues with the file dialogs/browser.

I've improved on my original fix and created an AutoIT script and wrapper exe that does the process much more seamlessly.

Install Instructions:

1. Download GraalEditorW10.zip
2. Extract GraalEditorW10.exe to your Graal folder
3. Right-click GraalEditorW10.exe and Run As Administrator
4. Select your GraalEditor.exe when prompted
5. Click OK to the prompt indicating changes were made to system files

After installing you no longer need to run GraalEditorW10.exe as an Administrator unless it refuses to work properly.

Open With Configuration Instructions:

1. Right-click a level file.
2. Open With > Choose more apps
3. Check the box indicating to always open with this app
4. Select 'more apps' and scroll down to the bottom
5. Choose another app and find and select GraalEditorW10.exe

How it works:

1. GraalEditorW10.exe is an exe wrapper for an AutoIT script below
2. Checks and adjusts permissions of system files so they can't be accessed before editor is started
3. Kicks off the process to start the editor
4. Waits for the editor to close
5. Adjusts permissions back to allow other applications to access them

The only potential issue is if you have another application that requires those dlls while running the editor but in my experience I've yet to run into such a scenario.

If any future Windows updates make changes to the specified system files, you refresh/reinstall, or if you move your Graal folder to a different computer just re-install the fix by running it as an Administrator.

GraalEditorW10.au3 Source

PHP Code:
; Declare Functions

Func EnvWrite
($key_var$key_val
  
$result RegWrite("HKEY_CURRENT_USER\Environment"$key_var"REG_SZ"$key_val)
  If 
$result 1 Then
      
  
EndIf
EndFunc

Func EnvRead
($key_var)
  Return 
RegRead("HKEY_CURRENT_USER\Environment"$key_var)
EndFunc

Func GetFileName
($sFilePath)
    If 
Not IsString($sFilePathThen
        
Return SetError(10, -1)
    EndIf
    
    
Local $FileName StringRegExpReplace($sFilePath"^.*\\""")
    
    Return 
$FileName
EndFunc

Func GetOwner
($file)
    
Local $computer "."
    
Local $wmi ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" $computer "\root\cimv2")
 
    
Dim $res
    $res 
$wmi.ExecQuery("ASSOCIATORS OF {Win32_LogicalFileSecuritySetting='" $file "'} WHERE AssocClass=Win32_LogicalFileOwner ResultRole=Owner")
 
    For 
$val In $res
        
Return $val.AccountName
    Next
EndFunc

Check for GraalEditor Environment Variable
Force user to select their GraalEditor.exe
If EnvRead("GRAALEDITOR") == "" Or isAdmin() Or Not FileExists(EnvRead("GRAALEDITOR")) Then
  $editorpath 
FileOpenDialog("Select your GraalEditor.exe", @ScriptDir"Applications (*.exe)|All (*.*)")
  
EnvWrite("GRAALEDITOR"$editorpath)
Else
  
$editorpath EnvRead("GRAALEDITOR")
EndIf

Pull Filename from GraalEditor fullpath
$editor 
GetFileName($editorpath)

Determine System Folder to Target
If FileExists(EnvGet("windir") & "\SysWOW64\d2d1.dll"Then
  $sysfolder 
EnvGet("windir") & "\SysWOW64\"
Else
  
$sysfolder = EnvGet("windir") & "\system32\"
EndIf

; Verify Ownership of System Files OR if running as administrator
If isAdmin() Or Not GetOwner(
$sysfolder & "d2d1.dll") == EnvGet("username") Then

  If Not isAdmin() Then
  
    MsgBox(0, "
Error", "Re-run this as Administrator in order to make proper changes to system file permissions.")
  
  Else
  
    RunWait("
takeown /" & $sysfolder & "d2d1.dll", "", @SW_HIDE)
    RunWait("
takeown /" & $sysfolder & "d3d11.dll", "", @SW_HIDE)
    RunWait("
takeown /" & $sysfolder & "iertutil.dll", "", @SW_HIDE)
    
    MsgBox(0, "
Success", "Ownership of system files has been updatedYou no longer need to run this as an administrator.")

  EndIf

EndIf

; Deny Current User Access to System Files
RunWait("
icacls " & $sysfolder & "d2d1.dll //deny " & EnvGet("username") & ":(F)", "", @SW_HIDE)
RunWait("
icacls " & $sysfolder & "d3d11.dll //deny " & EnvGet("username") & ":(F)", "", @SW_HIDE)
RunWait("
icacls " & $sysfolder & "iertutil.dll //deny " & EnvGet("username") & ":(F)", "", @SW_HIDE)

; Check for Passed Arguments (to support open with functionality)
If 
$CmdLine[0] > 0 Then

  
$pid = Run('"' & @ScriptDir & "\" & $editor & '" ' & $CmdLine[1])

Else

  
$pid = Run('"' & @ScriptDir & "\" & $editor & '"')

EndIf

; Wait for GraalEditor to Close
While ProcessExists(
$pid)
  ; If error window detected just close the process for the user rather than force them to do it through task manager
  
$spid = WinGetProcess("Error")
  If 
$spid == $pid Then
    ProcessClose(
$pid)
  EndIf
  Sleep(1000)
WEnd

; Re-allow access to system files just in case other applications use them
If Not ProcessExists(
$editor) Then

  RunWait("
icacls " & $sysfolder & "d2d1.dll //grant " & EnvGet("username") & ":(F)", "", @SW_HIDE)
  RunWait("
icacls " & $sysfolder & "d3d11.dll //grant " & EnvGet("username") & ":(F)", "", @SW_HIDE)
  RunWait("
icacls " & $sysfolder & "iertutil.dll //grant " & EnvGet("username") & ":(F)", "", @SW_HIDE)

EndIf 
When all done correctly you should see this:

Attached Files
File Type: zip GraalEditorW10.zip (419.0 KB, 1088 views)
__________________
Quote:

Last edited by fowlplay4; 03-13-2016 at 05:15 PM..
Reply With Quote
  #2  
Old 03-13-2016, 04:15 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Nice, thanks a bunch for this
__________________
Reply With Quote
  #3  
Old 03-13-2016, 11:44 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Perfect! Thank you. (I can't rep you, as you've already been repped recently by me!)

I've shared this with the iEra staff
__________________
Reply With Quote
  #4  
Old 03-13-2016, 03:47 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
I've updated the fix to be more seamless and easier to install.
__________________
Quote:
Reply With Quote
  #5  
Old 03-17-2016, 01:17 AM
Stowen Stowen is offline
Graalian since '01
Join Date: Sep 2005
Location: Massachusets, USA
Posts: 156
Stowen will become famous soon enough
Send a message via AIM to Stowen Send a message via MSN to Stowen
Excellent, nice work man!
__________________
Quote:
Originally Posted by Felix_Xenophobe View Post
He is no carpenter's son but Stowen will breathe life into pc graal.
Unholy Nation is my home.
Reply With Quote
  #6  
Old 03-17-2016, 02:13 PM
Elk Elk is offline
Sr Marketing Strategist
Elk's Avatar
Join Date: Nov 2005
Location: Deerland
Posts: 3,829
Elk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant future
Send a message via ICQ to Elk Send a message via AIM to Elk Send a message via MSN to Elk Send a message via Yahoo to Elk
fphero4

Win X sux
__________________
iEra IGN: *Elk (Darkshire)
iCla. IGN: *Elk (Darkshire)
iZone IGN: *Elk (Darkshire)




Reply With Quote
  #7  
Old 03-18-2016, 05:10 AM
Kamaeru Kamaeru is offline
G2k1
Kamaeru's Avatar
Join Date: Dec 2001
Posts: 1,040
Kamaeru has much to be proud ofKamaeru has much to be proud ofKamaeru has much to be proud ofKamaeru has much to be proud ofKamaeru has much to be proud ofKamaeru has much to be proud of
Did anyone try Microsoft Application Compatibility Toolkit?

https://www.microsoft.com/en-us/down...s.aspx?id=7352
__________________
3DS friendcode: 1118-0226-7975
Reply With Quote
  #8  
Old 03-18-2016, 11:02 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Kamaeru View Post
Did anyone try Microsoft Application Compatibility Toolkit?

https://www.microsoft.com/en-us/down...s.aspx?id=7352
Going to try again now that I know what to block and load.

Edit: Couldn't make it work.
__________________
Quote:

Last edited by fowlplay4; 03-19-2016 at 12:52 AM..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:36 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.