稳定测试版
This commit is contained in:
28
resources/waiting.ps1
Normal file
28
resources/waiting.ps1
Normal file
@@ -0,0 +1,28 @@
|
||||
param([string]$LogPath = "$env:TEMP\waiting-log.txt")
|
||||
function Write-Log($m){ try{"[$(Get-Date -Format o)] $m" | Out-File $LogPath -Append -Encoding UTF8}catch{} }
|
||||
|
||||
try{
|
||||
[System.Threading.Thread]::CurrentThread.TrySetApartmentState('STA') | Out-Null
|
||||
Add-Type -AssemblyName PresentationFramework | Out-Null
|
||||
|
||||
$xaml = @'
|
||||
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
Title="Installing..." Width="420" Height="160"
|
||||
WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Topmost="True">
|
||||
<Grid Margin="16">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Installing the new version, please wait..." Margin="0,0,0,12" FontSize="16" FontWeight="Bold"/>
|
||||
<ProgressBar IsIndeterminate="True" Height="18"/>
|
||||
<TextBlock Name="Status" Margin="0,10,0,0" Opacity="0.8" Text="Do not close your computer."/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
'@
|
||||
|
||||
$win = [Windows.Markup.XamlReader]::Parse($xaml)
|
||||
Write-Log "ShowDialog begin"
|
||||
$null = $win.ShowDialog()
|
||||
Write-Log "ShowDialog end"
|
||||
}catch{
|
||||
Write-Log "FATAL: $($_.Exception.Message)`n$($_.Exception.StackTrace)"
|
||||
}
|
||||
Reference in New Issue
Block a user