Skip to content

Commit

Permalink
fix: Launch / Install button functions (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonjgardner authored Sep 6, 2024
2 parents 1eb5d78 + 9330495 commit 6e0e631
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions v2/installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ foreach ($mc in (Get-AppxPackage -Name "Microsoft.Minecraft*")) {
$dataSrc += [PSCustomObject]@{
FriendlyName = (Get-AppxPackageManifest -Package $mc).Package.Properties.DisplayName
InstallLocation = $mc.InstallLocation
Preview = ($mc.InstallLocation -like "*Beta*" -or $mc.FriendlyName -like "*Preview*")
}
}

Expand Down Expand Up @@ -754,7 +755,12 @@ $LaunchButton.Add_Click({

$LaunchButton.Enabled = $false

Start-Process -FilePath "$($mc.InstallLocation)\Minecraft.Windows.exe" -PassThru
if ($mc.Preview -eq $true) {
Start-Process minecraft-preview:
}
else {
Start-Process minecraft:
}

$LaunchButton.Visible = $false
})
Expand All @@ -765,7 +771,7 @@ $InstallButton.Font = New-Object System.Drawing.Font("Arial", 12, [System.Drawin
$InstallButton.Width = $containerWidth
$InstallButton.Height = $lineHeight
$InstallButton.Anchor = 'Bottom'
$InstallButton.Enabled = $false
$InstallButton.Enabled = $ListBox.Items.Count -eq 1

$InstallButton.Add_Click({
$StatusLabel.Visible = $false
Expand Down

0 comments on commit 6e0e631

Please sign in to comment.