Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20

Thread: Graal Editor Fix for Windows 10!!

  1. #1
    Not Actually Banned Yet Bulletzone's Avatar
    Join Date
    Apr 2015
    Location
    United Kingdom
    Posts
    2,849

    Graal Editor Fix for Windows 10!!

    Disclaimer: I did not make any of this, so all credits to fp4!
    Please if you have time and a Graalians account, Go REP him for making our lives easier

    Quote Originally Posted by fp4 View Post
    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      EnvUpdate()  EndIfEndFunc
    Func GetFileName
    ($sFilePath)    If Not IsString($sFilePathThen        Return SetError(10, -1)    EndIf        Local $FileName StringRegExpReplace($sFilePath"^.*\\""")        Return $FileNameEndFunc
    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    NextEndFunc
    Check for GraalEditor Environment VariableForce user to select their GraalEditor.exeIf EnvGet("GRAALEDITOR") == "" Or isAdmin() Or Not FileExists(EnvGet("GRAALEDITOR")) Then  $editorpath FileOpenDialog("Select your GraalEditor.exe", @ScriptDir"Applications (*.exe)|All (*.*)")  EnvWrite("GRAALEDITOR"$editorpath)Else  $editorpath EnvGet("GRAALEDITOR")EndIf
    Pull Filename from GraalEditor fullpath$editor GetFileName($editorpath)
    Verify Ownership of System Files OR if running as administratorIf isAdmin() Or Not GetOwner("C:\Windows\SysWOW64\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 /F C:\Windows\SysWOW64\d2d1.dll""", @SW_HIDE)    RunWait("takeown /F C:\Windows\SysWOW64\d3d11.dll""", @SW_HIDE)    RunWait("takeown /F C:\Windows\SysWOW64\iertutil.dll""", @SW_HIDE)        MsgBox(0"Success""Ownership of system files has been updated! You no longer need to run this as an administrator.")
      EndIf
    EndIf
    Deny Current User Access to System FilesRunWait("icacls C:\Windows\SysWOW64\d2d1.dll /Q /deny " EnvGet("username") & ":(F)""", @SW_HIDE)RunWait("icacls C:\Windows\SysWOW64\d3d11.dll /Q /deny " EnvGet("username") & ":(F)""", @SW_HIDE)RunWait("icacls C:\Windows\SysWOW64\iertutil.dll /Q /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 CloseWhile 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(500)WEnd
    ; Re-allow access to system files just in case other applications use themIf Not ProcessExists(
    $editor) Then
      RunWait("
    icacls C:\Windows\SysWOW64\d2d1.dll //grant " & EnvGet("username") & ":(F)", "", @SW_HIDE)  RunWait("icacls C:\Windows\SysWOW64\d3d11.dll //grant " & EnvGet("username") & ":(F)", "", @SW_HIDE)  RunWait("icacls C:\Windows\SysWOW64\iertutil.dll //grant " & EnvGet("username") & ":(F)", "", @SW_HIDE)
    EndIf 

    When all done correctly you should see this:



    Link to Download File
    Last edited by Bulletzone; 02-07-2017 at 08:45 PM.
    "A fool thinks they know everything but a wise person knows there's something to learn from everyone"
    -
    "Great leaders don't complain about the tools they are given. They work to sharpen them"

  2. #2
    Veteran
    Join Date
    Feb 2015
    Location
    United States
    Posts
    410
    ooh, I'm sure this will be very helpful for many people.
    Thx fp4 and Bulletzone
    Hi.
    My YouTube channel: Lightning23

  3. #3
    Street Boss Mr LebJoe S's Avatar
    Join Date
    Aug 2014
    Location
    liechtestein
    Posts
    781
    Thanks
    ineffable.

  4. #4
    Street Boss Power5327's Avatar
    Join Date
    Apr 2014
    Location
    Lebanon
    Posts
    633
    I didn't upgrade to windows 10 because of graal editor.
    Now i can do it finally, tyy for sharing

  5. #5
    wow. that's awesome. I'll need to try that.

  6. #6
    Quote Originally Posted by Yoshimitsu View Post
    wow. that's awesome. I'll need to try that.
    For anyone new wanting to try this, don't. It's given me issues with tons of programs on my computer and disabled me from downloading a lot of new ones. I've tried reversing everything the script causes to no avail. Still trying to find a way to stop the script.

  7. #7
    Its not working for me... Nothing happens when I double click after following instructions
    since 2010/early 2011

  8. #8
    i know this is an old post but it didnt work for me, what should i do?

  9. #9
    Sir Where can i download GraalEditorw10.zip

    - - - Updated - - -

    Quote Originally Posted by Bulletzone View Post
    Disclaimer: I did not make any of this, so all credits to fp4!
    Please if you have time and a Graalians account, Go REP him for making our lives easier



    Link to Download File
    Sir it didnt work....

  10. #10
    Not Actually Banned Yet Bulletzone's Avatar
    Join Date
    Apr 2015
    Location
    United Kingdom
    Posts
    2,849
    Quote Originally Posted by Dean Santos View Post
    i know this is an old post but it didnt work for me, what should i do?
    What exactly happens?
    Any error messages?

    Quote Originally Posted by bandoo View Post
    Its not working for me... Nothing happens when I double click after following instructions
    ^^^

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •