@ECHO OFF&(PUSHD "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(
powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)

reg add "HKCU\Software\EdrawSoft" /f >NUL 2>NUL

reg add "HKLM\SOFTWARE\Classes\.emmx" /f /ve /d "MindMaster.Document" >NUL 2>NUL
reg add "HKLM\SOFTWARE\Classes\.emmx\shellNew" /f /ve /d "" >NUL 2>NUL
reg add "HKLM\SOFTWARE\Classes\.emmx\shellNew" /f /v "NullFile" /d "" >NUL 2>NUL

reg add "HKLM\SOFTWARE\Classes\MindMaster.Document" /f /ve /d "MindMaster.Document" >NUL 2>NUL
reg add "HKLM\SOFTWARE\Classes\MindMaster.Document\DefaultIcon" /f /ve /d "%~dp0MindMaster-1.exe,1" >NUL 2>NUL
reg add "HKLM\SOFTWARE\Classes\MindMaster.Document\DocObject" /f /ve /d "0" >NUL 2>NUL
reg add "HKLM\SOFTWARE\Classes\MindMaster.Document\shell\open\command" /f /ve /d "\"%~dp0MindMaster-1.exe\" \"%%1\"" >NUL 2>NUL

ASSOC .=. >NUL 2>NUL

::创建桌面快捷方式
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\MindMaster.lnk""):b.TargetPath=""%~sdp0MindMaster-1.exe"":b.WorkingDirectory=""%~sdp0"":b.Save:close")

ECHO.&ECHO 完成 &TIMEOUT /t 2 >NUL&EXIT