#Requires -RunAsAdministrator <# .SYNOPSIS Instala Microsoft Store y aplicaciones seleccionadas en Windows 11 LTSC 2024 .DESCRIPTION Script interactivo con interfaz grafica de checkboxes para seleccionar aplicaciones .EXAMPLE irm https://tu-dominio.com/install-store-menu.ps1 | iex #> $ErrorActionPreference = "Stop" # Verificar permisos de administrador $currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) if (-not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Host "[!] Este script debe ejecutarse como Administrador" -ForegroundColor Red exit 1 } # Cargar Windows Forms Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing # URL base del repositorio $BaseUrl = "https://github.com/minihub/LTSC-Add-MicrosoftStore/releases/download/LTSC-Add-MicrosoftStore-24H2" # Lista de aplicaciones disponibles $Applications = @( @{ Name = "Microsoft Store (Principal)"; File = "LTSC-Add-MicrosoftStore-24H2.zip"; Required = $true }, @{ Name = "Calculadora"; File = "Microsoft.WindowsCalculator.zip" }, @{ Name = "Bloc de Notas"; File = "Microsoft.WindowsNotepad.zip" }, @{ Name = "Terminal de Windows"; File = "Microsoft.WindowsTerminal.zip" }, @{ Name = "Paint"; File = "Microsoft.Paint.zip" }, @{ Name = "Fotos"; File = "Microsoft.Windows.Photos.zip" }, @{ Name = "Camara"; File = "Microsoft.WindowsCamera.zip" }, @{ Name = "Alarmas y Reloj"; File = "Microsoft.WindowsAlarms.zip" }, @{ Name = "Grabadora de Sonidos"; File = "Microsoft.WindowsSoundRecorder.zip" }, @{ Name = "Solitario"; File = "Microsoft.MicrosoftSolitaireCollection.zip" }, @{ Name = "El Tiempo (Bing Weather)"; File = "Microsoft.BingWeather.zip" }, @{ Name = "Noticias (Bing News)"; File = "Microsoft.BingNews.zip" }, @{ Name = "Xbox Game Pass"; File = "Microsoft.GamingApp.zip" }, @{ Name = "Tu Telefono"; File = "Microsoft.YourPhone.zip" }, @{ Name = "Microsoft Teams"; File = "MSTeams.zip" }, @{ Name = "Outlook"; File = "Microsoft.OutlookForWindows.zip" }, @{ Name = "Power Automate"; File = "Microsoft.PowerAutomateDesktop.zip" }, @{ Name = "Whiteboard"; File = "Microsoft.Whiteboard.zip" }, @{ Name = "Dev Home"; File = "DevHome.zip" }, @{ Name = "Windows App Runtime"; File = "Microsoft.WindowsAppRuntime.zip" }, @{ Name = "UI Xaml"; File = "Microsoft.UI.Xaml.zip" }, @{ Name = "VCLibs"; File = "Microsoft.VCLibs.zip" }, @{ Name = ".NET Native"; File = "Microsoft.NET.Native.zip" }, @{ Name = "Get Help"; File = "Microsoft.GetHelp.zip" }, @{ Name = "Feedback Hub"; File = "Microsoft.WindowsFeedbackHub.zip" }, @{ Name = "Microsoft Family"; File = "MicrosoftCorporationII.MicrosoftFamily.zip" }, @{ Name = "Quick Assist"; File = "MicrosoftCorporationII.QuickAssist.zip" }, @{ Name = "Clipchamp"; File = "Clipchamp.Clipchamp.zip" }, @{ Name = "Bing Search"; File = "Microsoft.BingSearch.zip" }, @{ Name = "HEIF Image Extension"; File = "Microsoft.HEIFImageExtension.zip" }, @{ Name = "Webp Image Extension"; File = "Microsoft.WebpImageExtension.zip" }, @{ Name = "Web Media Extensions"; File = "Microsoft.WebMediaExtensions.zip" }, @{ Name = "VP9 Video Extensions"; File = "Microsoft.VP9VideoExtensions.zip" }, @{ Name = "AV1 Video Extension"; File = "Microsoft.AV1VideoExtension.zip" }, @{ Name = "MPEG2 Video Extension"; File = "Microsoft.MPEG2VideoExtension.zip" }, @{ Name = "Raw Image Extension"; File = "Microsoft.RawImageExtension.zip" }, @{ Name = "AVC Encoder Video Extension"; File = "Microsoft.AVCEncoderVideoExtension.zip" }, @{ Name = "Xbox Identity Provider"; File = "Microsoft.XboxIdentityProvider.zip" }, @{ Name = "Xbox TCUI"; File = "Microsoft.Xbox.TCUI.zip" }, @{ Name = "Xbox Gaming Overlay"; File = "Microsoft.XboxGamingOverlay.zip" }, @{ Name = "Xbox Speech-to-Text Overlay"; File = "Microsoft.XboxSpeechToTextOverlay.zip" }, @{ Name = "Zune Music"; File = "Microsoft.ZuneMusic.zip" }, @{ Name = "Messaging"; File = "Microsoft.Messaging.zip" }, @{ Name = "OneConnect"; File = "Microsoft.OneConnect.zip" }, @{ Name = "SecHealthUI"; File = "Microsoft.SecHealthUI.zip" }, @{ Name = "Services Store Engagement"; File = "Microsoft.Services.Store.Engagement.zip" }, @{ Name = "Todos"; File = "Microsoft.Todos.zip" }, @{ Name = "Sticky Notes"; File = "Microsoft.MicrosoftStickyNotes.zip" }, @{ Name = "Journal"; File = "Microsoft.MicrosoftJournal.zip" }, @{ Name = "Office Hub"; File = "Microsoft.MicrosoftOfficeHub.zip" }, @{ Name = "PC Manager"; File = "Microsoft.MicrosoftPCManager.zip" }, @{ Name = "Screen Sketch"; File = "Microsoft.ScreenSketch.zip" }, @{ Name = "Auto Super Resolution"; File = "Microsoft.AutoSuperResolution.zip" }, @{ Name = "Application Compatibility Enhancements"; File = "Microsoft.ApplicationCompatibilityEnhancements.zip" }, @{ Name = "D3D Mapping Layers"; File = "Microsoft.D3DMappingLayers.zip" }, @{ Name = "Web Experience"; File = "MicrosoftWindows.Client.WebExperience.zip" }, @{ Name = "Cross Device"; File = "MicrosoftWindows.CrossDevice.zip" }, @{ Name = "FlipGrid PWA"; File = "FlipGridPWA.zip" } ) # Crear formulario $form = New-Object System.Windows.Forms.Form $form.Text = "Instalador Microsoft Store - Windows 11 LTSC 2024" $form.Size = New-Object System.Drawing.Size(600, 700) $form.StartPosition = "CenterScreen" $form.FormBorderStyle = "FixedDialog" $form.MaximizeBox = $false # Titulo $titleLabel = New-Object System.Windows.Forms.Label $titleLabel.Text = "Selecciona las aplicaciones a instalar:" $titleLabel.Location = New-Object System.Drawing.Point(10, 10) $titleLabel.Size = New-Object System.Drawing.Size(560, 25) $titleLabel.Font = New-Object System.Drawing.Font("Segoe UI", 12, [System.Drawing.FontStyle]::Bold) $form.Controls.Add($titleLabel) # Panel con scroll para los checkboxes $panel = New-Object System.Windows.Forms.Panel $panel.Location = New-Object System.Drawing.Point(10, 40) $panel.Size = New-Object System.Drawing.Size(560, 500) $panel.AutoScroll = $true $form.Controls.Add($panel) # Crear checkboxes $checkboxes = @() $y = 10 for ($i = 0; $i -lt $Applications.Count; $i++) { $app = $Applications[$i] $cb = New-Object System.Windows.Forms.CheckBox $cb.Text = $app.Name $cb.Location = New-Object System.Drawing.Point(10, $y) $cb.Size = New-Object System.Drawing.Size(500, 24) $cb.Font = New-Object System.Drawing.Font("Segoe UI", 10) if ($app.Required) { $cb.Checked = $true $cb.Enabled = $false $cb.Text = "$($app.Name) [REQUERIDO]" $cb.ForeColor = [System.Drawing.Color]::DarkBlue } $panel.Controls.Add($cb) $checkboxes += $cb $y += 28 } # Botones $btnSelectAll = New-Object System.Windows.Forms.Button $btnSelectAll.Text = "Seleccionar Todas" $btnSelectAll.Location = New-Object System.Drawing.Point(10, 550) $btnSelectAll.Size = New-Object System.Drawing.Size(120, 35) $btnSelectAll.Font = New-Object System.Drawing.Font("Segoe UI", 9) $btnSelectAll.Add_Click({ foreach ($cb in $checkboxes) { if ($cb.Enabled) { $cb.Checked = $true } } }) $form.Controls.Add($btnSelectAll) $btnDeselectAll = New-Object System.Windows.Forms.Button $btnDeselectAll.Text = "Deseleccionar Todas" $btnDeselectAll.Location = New-Object System.Drawing.Point(140, 550) $btnDeselectAll.Size = New-Object System.Drawing.Size(130, 35) $btnDeselectAll.Font = New-Object System.Drawing.Font("Segoe UI", 9) $btnDeselectAll.Add_Click({ foreach ($cb in $checkboxes) { if ($cb.Enabled) { $cb.Checked = $false } } }) $form.Controls.Add($btnDeselectAll) $btnInstall = New-Object System.Windows.Forms.Button $btnInstall.Text = "Instalar Seleccionadas" $btnInstall.Location = New-Object System.Drawing.Point(350, 550) $btnInstall.Size = New-Object System.Drawing.Size(150, 35) $btnInstall.Font = New-Object System.Drawing.Font("Segoe UI", 10, [System.Drawing.FontStyle]::Bold) $btnInstall.Add_Click({ $script:selectedApps = @() for ($i = 0; $i -lt $checkboxes.Count; $i++) { if ($checkboxes[$i].Checked) { $script:selectedApps += $Applications[$i] } } $form.Close() }) $form.Controls.Add($btnInstall) # Mostrar formulario $form.ShowDialog() | Out-Null # Verificar si se seleccionaron aplicaciones if (-not $script:selectedApps -or $script:selectedApps.Count -eq 0) { Write-Host "[!] No se seleccionaron aplicaciones. Saliendo..." -ForegroundColor Yellow exit 0 } # Crear directorio temporal $TempDir = Join-Path $env:TEMP "LTSC-Store-Install" if (Test-Path $TempDir) { Remove-Item -Recurse -Force $TempDir } New-Item -ItemType Directory -Path $TempDir -Force | Out-Null Write-Host "" Write-Host "============================================================" -ForegroundColor Cyan Write-Host " Instalando aplicaciones seleccionadas..." -ForegroundColor Cyan Write-Host "============================================================" -ForegroundColor Cyan Write-Host "" function Install-Application { param( [string]$Name, [string]$FileName, [string]$TempDir ) $ZipFile = Join-Path $TempDir $FileName $ExtractDir = Join-Path $TempDir ([System.IO.Path]::GetFileNameWithoutExtension($FileName)) Write-Host "[*] Descargando $Name..." -ForegroundColor Cyan try { $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri "$BaseUrl/$FileName" -OutFile $ZipFile -UseBasicParsing Write-Host " [OK] Descarga completada" -ForegroundColor Green } catch { Write-Host " [ERROR] No se pudo descargar: $_" -ForegroundColor Red return $false } Write-Host "[*] Extrayendo $Name..." -ForegroundColor Cyan try { Expand-Archive -Path $ZipFile -DestinationPath $ExtractDir -Force Write-Host " [OK] Extraccion completada" -ForegroundColor Green } catch { Write-Host " [ERROR] No se pudo extraer: $_" -ForegroundColor Red return $false } # Buscar archivos .appx, .appxbundle, .msix, .msixbundle $appxFiles = Get-ChildItem -Path $ExtractDir -Recurse -Include "*.appx", "*.appxbundle", "*.msix", "*.msixbundle" -ErrorAction SilentlyContinue if (-not $appxFiles) { Write-Host " [ERROR] No se encontraron archivos de instalacion" -ForegroundColor Red return $false } Write-Host "[*] Instalando $Name..." -ForegroundColor Cyan $installed = $false foreach ($file in $appxFiles) { try { Write-Host " Instalando: $($file.Name)" -ForegroundColor DarkGray Add-AppxPackage -Path $file.FullName -ErrorAction Stop $installed = $true } catch { Write-Host " [ERROR] $($file.Name): $_" -ForegroundColor Red } } if ($installed) { Write-Host " [OK] $Name instalado correctamente" -ForegroundColor Green return $true } return $false } # Instalar aplicaciones seleccionadas $successCount = 0 $failCount = 0 foreach ($app in $script:selectedApps) { $result = Install-Application -Name $app.Name -FileName $app.File -TempDir $TempDir if ($result) { $successCount++ } else { $failCount++ } } # Limpiar Write-Host "" Write-Host "[*] Limpiando archivos temporales..." -ForegroundColor Cyan Start-Sleep -Seconds 2 Remove-Item -Recurse -Force $TempDir -ErrorAction SilentlyContinue # Resumen final Write-Host "" Write-Host "============================================================" -ForegroundColor Green Write-Host " Instalacion completada" -ForegroundColor Green Write-Host "============================================================" -ForegroundColor Green Write-Host " Exitosas: $successCount" -ForegroundColor Green Write-Host " Fallidas: $failCount" -ForegroundColor Red Write-Host "============================================================" -ForegroundColor Green Write-Host "" Write-Host " Se recomienda reiniciar el equipo para completar la instalacion." -ForegroundColor Yellow Write-Host ""