Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Launch / Install button functions #108

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading