forked from TGSAN/CMWTAT_Digital_Edition
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectRun.ps1
More file actions
15 lines (12 loc) · 730 Bytes
/
Copy pathDirectRun.ps1
File metadata and controls
15 lines (12 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$isAdmin = (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) {
Start-Process powershell -ArgumentList "irm https://tgsan.github.io/CMWTAT_Digital_Edition/DirectRun.ps1 | iex" -Verb RunAs
Exit
}
# $exePath = ".\CMWTAT_DIGITAL\bin\Debug\CMWTAT_DIGITAL.exe"
# $exeBytes = [System.IO.File]::ReadAllBytes($exePath)
# $bytes = $exeBytes
$bytes = (Invoke-WebRequest "https://tgsan.github.io/CMWTAT_Digital_Edition/CMWTAT_Digital_Release_2_7_2_0.exe").Content
$assembly = [System.Reflection.Assembly]::Load($bytes)
$entryPointMethod = $assembly.EntryPoint
$entryPointMethod.Invoke($null, @())