# Memanggil mesin GUI bawaan Windows Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing # 1. Membuat Jendela Utama (Form) $mainForm = New-Object System.Windows.Forms.Form $mainForm.Text = "Meprofarm IT Setup Tool" $mainForm.Size = New-Object System.Drawing.Size(350,250) $mainForm.StartPosition = "CenterScreen" # 2. Membuat Judul (Label) $label = New-Object System.Windows.Forms.Label $label.Text = "Pilih aplikasi yang mau diinstall:" $label.Location = New-Object System.Drawing.Point(20,20) $label.AutoSize = $true $mainForm.Controls.Add($label) # 3. Membuat Checkbox 1 (Chrome) $checkChrome = New-Object System.Windows.Forms.CheckBox $checkChrome.Text = "Google Chrome" $checkChrome.Location = New-Object System.Drawing.Point(20,50) $mainForm.Controls.Add($checkChrome) # 4. Membuat Checkbox 2 (7-Zip) $check7Zip = New-Object System.Windows.Forms.CheckBox $check7Zip.Text = "7-Zip" $check7Zip.Location = New-Object System.Drawing.Point(20,80) $mainForm.Controls.Add($check7Zip) # 5. Membuat Tombol Install $btnInstall = New-Object System.Windows.Forms.Button $btnInstall.Text = "Install Sekarang" $btnInstall.Location = New-Object System.Drawing.Point(20,130) $btnInstall.Size = New-Object System.Drawing.Size(120,40) # Logika ketika tombol ditekan $btnInstall.Add_Click({ $mainForm.Hide() # Sembunyikan GUI saat proses berjalan if ($checkChrome.Checked) { Write-Host "Menginstal Chrome..." -ForegroundColor Green # Nanti perintah winget install Chrome ditaruh di sini } if ($check7Zip.Checked) { Write-Host "Menginstal 7-Zip..." -ForegroundColor Green # Nanti perintah winget install 7zip ditaruh di sini } Write-Host "Proses Selesai!" -ForegroundColor Yellow $mainForm.Close() }) $mainForm.Controls.Add($btnInstall) # Menampilkan Jendela $mainForm.ShowDialog() | Out-Null