Extract the contents in temp when you run the setup exe file.
Install.ps1
# Run .NET Desktop Runtime installer $runtimeInstaller = Join-Path -Path $PSScriptRoot -ChildPath "netdesktopruntime.exe" $logPath = Join-Path -Path $env:TEMP -ChildPath "microsoft_windows_desktop_runtime.install.log" $installCmd = "$runtimeInstaller /install /quiet /norestart /log $logPath" Write-Host "Installing .NET Desktop Runtime..." Start-Process "cmd.exe" -ArgumentList "/c $installCmd" -Wait -NoNewWindow # Install the MSIX package $msixPath = Join-Path -Path $PSScriptRoot -ChildPath "MSIX_MUSEHUB.msix" Write-Host "Installing MSIX package from: $msixPath" Add-AppxPackage -Path $msixPath -ErrorAction Stop Write-Host "Installation completed."
Uninstall.ps1
# Uninstall the MSIX package $packageFullName = "Muse.MuseHub_2.0.17.1335_x64__rb9pth70m6nz6" # Replace with the actual package full name Write-Host "Uninstalling MSIX package: $packageFullName" Remove-AppxPackage -Package $packageFullName -ErrorAction Stop # Run .NET Desktop Runtime uninstaller $runtimeInstaller = "$PSScriptRoot\netdesktopruntime.exe" $logPath = "$env:TEMP\microsoft_windows_desktop_runtime.install.log" if (Test-Path $runtimeInstaller) { $uninstallCmd = "/uninstall /quiet /norestart /log `"$logPath`"" Write-Host "Uninstalling .NET Desktop Runtime..." Start-Process -FilePath $runtimeInstaller -ArgumentList $uninstallCmd -Wait -NoNewWindow } else { Write-Host "Runtime installer not found at: $runtimeInstaller" } Write-Host "Uninstallation completed."
No comments:
Post a Comment