16 lines
584 B
PowerShell
16 lines
584 B
PowerShell
$ErrorActionPreference = "Stop"
|
|
$ProjectRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
$Pubspec = Join-Path $ProjectRoot "pubspec.yaml"
|
|
$Version = "1.0.0"
|
|
if (Test-Path $Pubspec) {
|
|
$Text = Get-Content $Pubspec -Raw
|
|
if ($Text -match '(?m)^version:\s*([^\s+]+)(?:\+\S+)?\s*$') {
|
|
$Version = $Matches[1].Trim()
|
|
}
|
|
}
|
|
$Setup = Join-Path $ProjectRoot "dist\YouTube_Personal_Setup_$Version.exe"
|
|
if (-not (Test-Path $Setup)) {
|
|
throw "Installateur introuvable : $Setup`nLance d'abord .\CREER_INSTALLATEUR_WINDOWS.ps1"
|
|
}
|
|
Start-Process -FilePath $Setup -Verb RunAs
|