Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing [System.Windows.Forms.Application]::EnableVisualStyles() if (-not ("NativeMethods" -as [type])) { $nativeMethodsSource = [string]::Join("`r`n", @( 'using System;', 'using System.Runtime.InteropServices;', '', 'public static class NativeMethods', '{', ' [DllImport("gdi32.dll")]', ' public static extern IntPtr CreateRoundRectRgn(', ' int nLeftRect,', ' int nTopRect,', ' int nRightRect,', ' int nBottomRect,', ' int nWidthEllipse,', ' int nHeightEllipse', ' );', '', ' [DllImport("user32.dll")]', ' public static extern bool ReleaseCapture();', '', ' [DllImport("user32.dll")]', ' public static extern IntPtr SendMessage(', ' IntPtr hWnd,', ' int Msg,', ' IntPtr wParam,', ' IntPtr lParam', ' );', '}' )) Add-Type -TypeDefinition $nativeMethodsSource } # ============================================================ # FUNKCIJE # ============================================================ function Set-RoundedRegion { param( [Parameter(Mandatory)] [System.Windows.Forms.Control]$Control, [int]$Radius = 16 ) $regionHandle = [NativeMethods]::CreateRoundRectRgn( 0, 0, $Control.Width, $Control.Height, $Radius, $Radius ) $Control.Region = [System.Drawing.Region]::FromHrgn($regionHandle) } function Start-EncodedPowerShellTool { param( [Parameter(Mandatory)] [string]$Command, [Parameter(Mandatory)] [string]$ToolName, [Parameter(Mandatory)] [System.Windows.Forms.Control]$TriggerControl, [Parameter(Mandatory)] [System.Drawing.Color]$ActiveColor ) $TriggerControl.Enabled = $false $StatusDot.ForeColor = $ActiveColor $StatusLabel.ForeColor = $ColorText $StatusLabel.Text = "Pokretanje: $ToolName" try { $encodedCommand = [Convert]::ToBase64String( [System.Text.Encoding]::Unicode.GetBytes($Command) ) Start-Process ` -FilePath "powershell.exe" ` -Verb RunAs ` -ArgumentList "-NoProfile -ExecutionPolicy Bypass -EncodedCommand $encodedCommand" ` -ErrorAction Stop $StatusDot.ForeColor = $ColorSuccess $StatusLabel.Text = "$ToolName je pokrenut." } catch { $StatusDot.ForeColor = $ColorError $StatusLabel.Text = "Pokretanje nije uspelo." [System.Windows.Forms.MessageBox]::Show( "Nije moguće pokrenuti stavku: $ToolName`r`n`r`n$($_.Exception.Message)", "Greška", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Error ) } finally { $TriggerControl.Enabled = $true } } function Start-DirectLinkTool { param( [Parameter(Mandatory)] [string]$Link, [Parameter(Mandatory)] [string]$ToolName, [Parameter(Mandatory)] [System.Windows.Forms.Control]$TriggerControl, [Parameter(Mandatory)] [System.Drawing.Color]$ActiveColor ) $TriggerControl.Enabled = $false $StatusDot.ForeColor = $ActiveColor $StatusLabel.ForeColor = $ColorText $StatusLabel.Text = "Otvaranje: $ToolName" try { Start-Process -FilePath $Link -ErrorAction Stop $StatusDot.ForeColor = $ColorSuccess $StatusLabel.Text = "$ToolName je otvoren." } catch { $StatusDot.ForeColor = $ColorError $StatusLabel.Text = "Otvaranje nije uspelo." [System.Windows.Forms.MessageBox]::Show( "Nije moguće otvoriti link: $ToolName`r`n`r`n$($_.Exception.Message)", "Greška", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Error ) } finally { $TriggerControl.Enabled = $true } } function New-LauncherCard { param( [Parameter(Mandatory)] [System.Windows.Forms.Control]$Parent, [Parameter(Mandatory)] [string]$Name, [Parameter(Mandatory)] [string]$Title, [Parameter(Mandatory)] [string]$Description, [Parameter(Mandatory)] [string]$IconText, [string]$IconUrl = '', [Parameter(Mandatory)] [int]$X, [Parameter(Mandatory)] [int]$Y, [Parameter(Mandatory)] [int]$Width, [Parameter(Mandatory)] [int]$Height, [Parameter(Mandatory)] [System.Drawing.Color]$AccentColor ) $panel = [System.Windows.Forms.Panel]::new() $panel.Name = "$Name`Card" $panel.Location = [System.Drawing.Point]::new($X, $Y) $panel.Size = [System.Drawing.Size]::new($Width, $Height) $panel.BackColor = $ColorCard $Parent.Controls.Add($panel) $iconPanel = [System.Windows.Forms.Panel]::new() $iconPanel.Name = "$Name`IconPanel" $iconPanel.Location = [System.Drawing.Point]::new(14, 14) $iconPanel.Size = [System.Drawing.Size]::new(44, 44) $iconPanel.BackColor = $AccentColor $panel.Controls.Add($iconPanel) $iconLabel = [System.Windows.Forms.Label]::new() $iconLabel.Text = $IconText $iconLabel.Dock = [System.Windows.Forms.DockStyle]::Fill $iconLabel.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter $iconLabel.ForeColor = [System.Drawing.Color]::White $iconLabel.Font = [System.Drawing.Font]::new( 'Segoe UI', 17, [System.Drawing.FontStyle]::Bold ) $iconPanel.Controls.Add($iconLabel) $iconPicture = [System.Windows.Forms.PictureBox]::new() $iconPicture.Dock = [System.Windows.Forms.DockStyle]::Fill $iconPicture.SizeMode = [System.Windows.Forms.PictureBoxSizeMode]::Zoom $iconPicture.Visible = $false $iconPanel.Controls.Add($iconPicture) if (-not [string]::IsNullOrWhiteSpace($IconUrl)) { $loadCompletedHandler = [System.ComponentModel.AsyncCompletedEventHandler]{ param($sender, $eventArgs) if (-not $eventArgs.Error -and -not $eventArgs.Cancelled -and $sender.Image) { $sender.Visible = $true $iconLabel.Visible = $false } }.GetNewClosure() $iconPicture.add_LoadCompleted($loadCompletedHandler) try { $iconPicture.LoadAsync($IconUrl) } catch { $iconPicture.Visible = $false $iconLabel.Visible = $true } } $titleLabel = [System.Windows.Forms.Label]::new() $titleLabel.Text = $Title $titleLabel.Location = [System.Drawing.Point]::new(68, 11) $titleLabel.Size = [System.Drawing.Size]::new($Width - 82, 22) $titleLabel.ForeColor = $ColorText $titleLabel.Font = [System.Drawing.Font]::new( 'Segoe UI', 10.2, [System.Drawing.FontStyle]::Bold ) $panel.Controls.Add($titleLabel) $descriptionLabel = [System.Windows.Forms.Label]::new() $descriptionLabel.Text = $Description $descriptionLabel.Location = [System.Drawing.Point]::new(68, 35) $descriptionLabel.Size = [System.Drawing.Size]::new($Width - 82, 38) $descriptionLabel.ForeColor = $ColorMuted $descriptionLabel.Font = [System.Drawing.Font]::new('Segoe UI', 8.4) $panel.Controls.Add($descriptionLabel) foreach ($control in @($panel, $iconPanel, $iconLabel, $iconPicture, $titleLabel, $descriptionLabel)) { if ($null -ne $control) { $control.Cursor = [System.Windows.Forms.Cursors]::Hand } } return [pscustomobject]@{ Panel = $panel IconPanel = $iconPanel IconLabel = $iconLabel IconPicture = $iconPicture TitleLabel = $titleLabel DescriptionLabel = $descriptionLabel } } function Register-LauncherCardAction { param( [Parameter(Mandatory)] $Card, [Parameter(Mandatory)] [string]$Command, [Parameter(Mandatory)] [string]$ToolName, [Parameter(Mandatory)] [System.Drawing.Color]$ActiveColor, [string]$ActionMode = 'encoded' ) $frozenCommand = $Command $frozenToolName = $ToolName $frozenPanel = $Card.Panel $frozenActiveColor = $ActiveColor $frozenActionMode = $ActionMode $clickHandler = { if ($frozenActionMode -eq 'link') { Start-DirectLinkTool ` -Link $frozenCommand ` -ToolName $frozenToolName ` -TriggerControl $frozenPanel ` -ActiveColor $frozenActiveColor } else { Start-EncodedPowerShellTool ` -Command $frozenCommand ` -ToolName $frozenToolName ` -TriggerControl $frozenPanel ` -ActiveColor $frozenActiveColor } }.GetNewClosure() foreach ($target in @( $Card.Panel, $Card.IconPanel, $Card.IconLabel, $Card.IconPicture, $Card.TitleLabel, $Card.DescriptionLabel )) { $target.Add_Click($clickHandler) } } function Add-CardSection { param( [Parameter(Mandatory)] [System.Windows.Forms.Control]$Parent, [Parameter(Mandatory)] [System.Collections.IEnumerable]$Items, [Parameter(Mandatory)] [int]$StartY ) $cards = [System.Collections.Generic.List[object]]::new() $currentY = $StartY $columnIndex = 0 foreach ($item in $Items) { $columnSpan = if ($item.PSObject.Properties.Name -contains 'ColumnSpan') { [int]$item.ColumnSpan } else { 1 } if ($columnSpan -eq 2 -and $columnIndex -ne 0) { $currentY += $Layout.CardHeight + $Layout.RowGap $columnIndex = 0 } if ($columnSpan -eq 2) { $x = $Layout.LeftX $width = $Layout.FullWidth } else { $x = if ($columnIndex -eq 0) { $Layout.LeftX } else { $Layout.RightX } $width = $Layout.ColumnWidth } $card = New-LauncherCard ` -Parent $Parent ` -Name $item.Name ` -Title $item.Title ` -Description $item.Description ` -IconText $item.IconText ` -IconUrl $(if ($item.PSObject.Properties.Name -contains 'IconUrl') { [string]$item.IconUrl } elseif (-not [string]::IsNullOrWhiteSpace($IconBaseUrl) -and $item.PSObject.Properties.Name -contains 'IconFile') { '{0}/{1}' -f $IconBaseUrl.TrimEnd('/') , ([string]$item.IconFile).TrimStart('/') } else { '' }) ` -X $x ` -Y $currentY ` -Width $width ` -Height $Layout.CardHeight ` -AccentColor $item.AccentColor Register-LauncherCardAction ` -Card $card ` -Command $item.Command ` -ToolName $item.ToolName ` -ActiveColor $item.AccentColor ` -ActionMode $(if ($item.PSObject.Properties.Name -contains 'ActionMode') { $item.ActionMode } else { 'encoded' }) [void]$cards.Add($card) if ($columnSpan -eq 2) { $currentY += $Layout.CardHeight + $Layout.RowGap $columnIndex = 0 } elseif ($columnIndex -eq 0) { $columnIndex = 1 } else { $currentY += $Layout.CardHeight + $Layout.RowGap $columnIndex = 0 } } if ($columnIndex -eq 1) { $currentY += $Layout.CardHeight + $Layout.RowGap } return [pscustomobject]@{ Cards = $cards NextY = $currentY } } # ============================================================ # BOJE # ============================================================ $ColorBackground = [System.Drawing.ColorTranslator]::FromHtml("#111827") $ColorTopBar = [System.Drawing.ColorTranslator]::FromHtml("#172033") $ColorCard = [System.Drawing.ColorTranslator]::FromHtml("#1F2937") $ColorPrimary = [System.Drawing.ColorTranslator]::FromHtml("#2563EB") $ColorPrimaryHover = [System.Drawing.ColorTranslator]::FromHtml("#1D4ED8") $ColorPurple = [System.Drawing.ColorTranslator]::FromHtml("#7C3AED") $ColorPurpleHover = [System.Drawing.ColorTranslator]::FromHtml("#6D28D9") $ColorSecondary = [System.Drawing.ColorTranslator]::FromHtml("#374151") $ColorSecondaryHover = [System.Drawing.ColorTranslator]::FromHtml("#4B5563") $ColorText = [System.Drawing.ColorTranslator]::FromHtml("#F9FAFB") $ColorMuted = [System.Drawing.ColorTranslator]::FromHtml("#9CA3AF") $ColorSuccess = [System.Drawing.ColorTranslator]::FromHtml("#22C55E") $ColorError = [System.Drawing.ColorTranslator]::FromHtml("#EF4444") # ============================================================ # LAYOUT # ============================================================ $Layout = [pscustomobject]@{ LeftX = 35 RightX = 320 FullWidth = 550 ColumnWidth = 265 CardHeight = 72 RowGap = 10 } # ============================================================ # KOMANDE # ============================================================ $WinUtilCommand = 'irm "https://christitus.com/win" | iex' $SokommCommand = 'irm "https://get.activated.win" | iex' $RemotelyInstallerUrl = 'https://ps.sokomm.org/Remotely_Installer.exe' $IconBaseUrl = 'https://ps.sokomm.org/toolbox-icons' # npr. https://moj-sajt.rs/toolbox-icons $RemotelyInstallCommand = [string]::Join("`r`n", @( '$downloadPath = Join-Path $env:TEMP "Remotely_Installer.exe"', '', 'try {', ' if (Test-Path -LiteralPath $downloadPath) {', ' Remove-Item -LiteralPath $downloadPath -Force -ErrorAction SilentlyContinue', ' }', '', ' Invoke-WebRequest `', ' -Uri "https://ps.sokomm.org/Remotely_Installer.exe" `', ' -OutFile $downloadPath `', ' -UseBasicParsing `', ' -ErrorAction Stop', '', ' if (-not (Test-Path -LiteralPath $downloadPath)) {', ' throw "Remotely Installer nije preuzet."', ' }', '', ' Start-Process `', ' -FilePath $downloadPath `', ' -Wait `', ' -ErrorAction Stop', '}', 'catch {', ' Add-Type -AssemblyName System.Windows.Forms', '', ' [System.Windows.Forms.MessageBox]::Show(', ' "Remotely Installer nije moguće preuzeti ili pokrenuti.`r`n`r`n$($_.Exception.Message)",', ' "Greška",', ' [System.Windows.Forms.MessageBoxButtons]::OK,', ' [System.Windows.Forms.MessageBoxIcon]::Error', ' )', '}' )) $BraveInstallCommand = [string]::Join("`r`n", @( '$downloadPath = Join-Path $env:TEMP "BraveBrowserSetup.exe"', '', 'try {', ' if (Test-Path -LiteralPath $downloadPath) {', ' Remove-Item -LiteralPath $downloadPath -Force -ErrorAction SilentlyContinue', ' }', '', ' Invoke-WebRequest `', ' -Uri "https://laptop-updates.brave.com/latest/winx64" `', ' -OutFile $downloadPath `', ' -UseBasicParsing `', ' -ErrorAction Stop', '', ' if (-not (Test-Path -LiteralPath $downloadPath)) {', ' throw "Brave Installer nije preuzet."', ' }', '', ' Start-Process `', ' -FilePath $downloadPath `', ' -Wait `', ' -ErrorAction Stop', '}', 'catch {', ' Add-Type -AssemblyName System.Windows.Forms', '', ' [System.Windows.Forms.MessageBox]::Show(', ' "Brave Installer nije moguće preuzeti ili pokrenuti.`r`n`r`n$($_.Exception.Message)",', ' "Greška",', ' [System.Windows.Forms.MessageBoxButtons]::OK,', ' [System.Windows.Forms.MessageBoxIcon]::Error', ' )', '}' )) $PhotoViewerCommand = [string]::Join("`r`n", @( '$regFile = Join-Path $env:TEMP "enable-photo-viewer.reg"', '$regContent = @(', ' ''Windows Registry Editor Version 5.00''', ' ''''', ' ''[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open]''', ' ''"MuiVerb"="@photoviewer.dll,-3043"''', ' ''''', ' ''[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command]''', ' ''@="\"%SystemRoot%\System32\rundll32.exe\" \"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll\", ImageView_Fullscreen %1"''', ' ''''', ' ''[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget]''', ' ''"Clsid"="{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"''', ' ''''', ' ''[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\command]''', ' ''@="\"%SystemRoot%\System32\rundll32.exe\" \"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll\", ImageView_PrintTo %1"''', ' ''''', ' ''[HKEY_CLASSES_ROOT\Applications\Windowsphotoviewer.dll\shell\print\DropTarget]''', ' ''"Clsid"="{60fd46de-f830-4894-a628-6fa81bc0190d}"''', ')', '$regContent | Set-Content -Path $regFile -Encoding Unicode', 'reg.exe import $regFile', 'Remove-Item -Path $regFile -Force -ErrorAction SilentlyContinue', 'Write-Host "Windows Photo Viewer podešavanje je primenjeno."' )) $LocaleCommand = [string]::Join("`r`n", @( 'Write-Host "Podesavanje regiona, vremena i jezika za non-Unicode programe na sr-Latn-RS..." -ForegroundColor Cyan', '$culture = "sr-Latn-RS"', 'try {', ' Set-Culture -CultureInfo $culture', ' Write-Host "Culture (regionalni format) je podesen na $culture."', '} catch {', ' Write-Host "Greska pri podesavanju Culture: $($_.Exception.Message)" -ForegroundColor Red', '}', 'try {', ' Set-WinSystemLocale -SystemLocale $culture', ' Write-Host "System locale (jezik za non-Unicode programe) je podesen na $culture."', '} catch {', ' Write-Host "Greska pri podesavanju System locale (pokreni kao Administrator): $($_.Exception.Message)" -ForegroundColor Red', '}', '$intlKey = "HKCU:\Control Panel\International"', 'try {', ' Set-ItemProperty $intlKey -Name sShortDate -Value "d.M.yyyy"', ' Set-ItemProperty $intlKey -Name sLongDate -Value "dddd, d. MMMM yyyy."', ' Set-ItemProperty $intlKey -Name sShortTime -Value "HH:mm"', ' Set-ItemProperty $intlKey -Name sTimeFormat -Value "HH:mm:ss"', ' Write-Host "Format datuma i vremena je podesen."', '} catch {', ' Write-Host "Greska pri podesavanju formata datuma/vremena: $($_.Exception.Message)" -ForegroundColor Red', '}', 'Write-Host "Dodavanje srpskih tastatura (latinica i cirilica), bez menjanja jezika interfejsa..."', 'try {', ' $languageList = Get-WinUserLanguageList', ' function Add-LangIfMissing([string]$tag, [ref]$listRef) {', ' if (-not ($listRef.Value.LanguageTag -contains $tag)) {', ' $listRef.Value.Add($tag) | Out-Null', ' Write-Host "Dodata tastatura / jezik: $tag"', ' }', ' }', ' Add-LangIfMissing "sr-Latn-RS" ([ref]$languageList)', ' Add-LangIfMissing "sr-Cyrl-RS" ([ref]$languageList)', ' Set-WinUserLanguageList -LanguageList $languageList -Force', ' Write-Host "Lista korisnickih jezika (tastatura) je azurirana."', '} catch {', ' Write-Host "Greska pri podesavanju tastatura: $($_.Exception.Message)" -ForegroundColor Red', '}', 'Write-Host ""', 'Write-Host "Gotovo." -ForegroundColor Green', 'Write-Host "Napomena: za promenu jezika za non-Unicode programe (System locale) potreban je restart racunara."' )) $StartMenuCommand = [string]::Join("`r`n", @( '$build = [int](Get-ComputerInfo -Property OsBuildNumber).OsBuildNumber', 'if ($build -lt 22000) {', ' Write-Host "Ovaj tweak nije primenljiv na Windows 10." -ForegroundColor Yellow', ' return', '}', 'if ($build -gt 26200) {', ' Write-Host "Na novijim Windows 11 buildovima ovaj tweak najverovatnije vise ne radi." -ForegroundColor Yellow', '}', '$path = "HKLM:\SYSTEM\ControlSet001\Control\FeatureManagement\Overrides\8\3036241548"', 'New-Item -Path $path -Force | Out-Null', 'New-ItemProperty -Path $path -Name EnabledState -Value 1 -PropertyType DWord -Force | Out-Null', 'Write-Host "Start Menu previous layout tweak je upisan. Ako je build podrzan, restartuj Explorer ili racunar." -ForegroundColor Green' )) $ContextMenuCommand = [string]::Join("`r`n", @( '$build = [int](Get-ComputerInfo -Property OsBuildNumber).OsBuildNumber', 'if ($build -lt 22000) {', ' Write-Host "Klasicni context menu tweak nije potreban na Windows 10." -ForegroundColor Yellow', ' return', '}', '$path = "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32"', 'New-Item -Path $path -Value "" -Force | Out-Null', 'Stop-Process -Name explorer -Force', 'Write-Host "Klasicni desni klik meni je omogucen. Explorer je restartovan." -ForegroundColor Green' )) $RdpWarningCommand = [string]::Join("`r`n", @( '$policyPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client"', '$userPath = "HKCU:\SOFTWARE\Microsoft\Terminal Server Client"', 'New-Item -Path $policyPath -Force | Out-Null', 'New-ItemProperty -Path $policyPath -Name RedirectionWarningDialogVersion -Value 1 -PropertyType DWord -Force | Out-Null', 'New-Item -Path $userPath -Force | Out-Null', 'New-ItemProperty -Path $userPath -Name RdpLaunchConsentAccepted -Value 1 -PropertyType DWord -Force | Out-Null', 'Write-Host "RDP upozorenja za nepotpisane fajlove su iskljucena." -ForegroundColor Green' )) $ThisPCCommand = [string]::Join("`r`n", @( '$thisPcClsid = "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"', '', '$registryPaths = @(', ' "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel",', ' "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu"', ')', '', 'foreach ($registryPath in $registryPaths) {', ' if (-not (Test-Path -LiteralPath $registryPath)) {', ' New-Item -Path $registryPath -Force | Out-Null', ' }', '', ' New-ItemProperty `', ' -Path $registryPath `', ' -Name $thisPcClsid `', ' -PropertyType DWord `', ' -Value 0 `', ' -Force | Out-Null', '}', '', 'Write-Host "Ikona This PC je dodata na desktop." -ForegroundColor Green', '', '# Osvežavanje Windows Explorer-a', 'Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue', 'Start-Sleep -Milliseconds 800', '', 'if (-not (Get-Process -Name explorer -ErrorAction SilentlyContinue)) {', ' Start-Process explorer.exe', '}' )) $ToolItems = @( [pscustomobject]@{ Name = 'WinUtil' IconFile = 'winutil.png' Title = 'WinUtil' Description = 'App install i sistemski tweakovi.' IconText = 'W' AccentColor = $ColorCard Command = $WinUtilCommand ToolName = 'Chris Titus WinUtil' ColumnSpan = 1 } [pscustomobject]@{ Name = 'MAS' IconFile = 'mas.png' Title = 'MAS' Description = 'Akrivacija Windowsa , Offica i ESU' IconText = 'M' AccentColor = $ColorCard Command = $SokommCommand ToolName = 'Sokomm Windows Tool' ColumnSpan = 1 } [pscustomobject]@{ Name = 'Remotely' IconFile = 'remotely.png' Title = 'Instaliraj Remotely' Description = 'Skida i pokrece Remotely installer.' IconText = 'R' AccentColor = $ColorCard Command = $RemotelyInstallCommand ToolName = 'Remotely Install' ColumnSpan = 1 } [pscustomobject]@{ Name = 'Brave' IconFile = 'brave.png' Title = 'Instaliraj Brave' Description = 'Skida i pokrece Brave installer.' IconText = 'R' AccentColor = $ColorCard Command = $BraveInstallCommand ToolName = 'Brave Install' ColumnSpan = 1 } ) $ScriptItems = @( [pscustomobject]@{ Name = 'PhotoViewer' IconFile = 'photo-viewer.png' Title = 'Photo Viewer' Description = 'Aktivira stari Windows Photo Viewer za Win 10 i 11 LTSC' IconText = 'P' AccentColor = $ColorCard Command = $PhotoViewerCommand ToolName = 'Windows Photo Viewer Aktivacija' ColumnSpan = 1 } [pscustomobject]@{ Name = 'Locale' IconFile = 'locale.png' Title = 'Srpski Region' Description = 'Dodaje RS tastature i menja format datuma' IconText = 'R' AccentColor = $ColorCard Command = $LocaleCommand ToolName = 'Srpski Region i Tastature' ColumnSpan = 1 } [pscustomobject]@{ Name = 'StartMenu' IconFile = 'start-menu.png' Title = 'Stari izgled Start menija' Description = 'Stari Start meni za Win 11.' IconText = 'M' AccentColor = $ColorCard Command = $StartMenuCommand ToolName = 'Windows 11 Start Menu Classic Layout' ColumnSpan = 1 } [pscustomobject]@{ Name = 'ContextMenu' IconFile = 'context-menu.png' Title = 'Stari Desni Klik Meni' Description = 'Vraćva klasicni desni klik meni za Windows 11.' IconText = 'C' AccentColor = $ColorSecondary Command = $ContextMenuCommand ToolName = 'Windows 11 Classic Context Menu' ColumnSpan = 1 } [pscustomobject]@{ Name = 'Rdp' IconFile = 'rdp.png' Title = 'RDP Warnings Off' Description = 'Gasi upozorenja za nepotpisane .rdp fajlove.' IconText = 'D' AccentColor = $ColorCard Command = $RdpWarningCommand ToolName = 'RDP Unsigned File Warnings' ColumnSpan = 1 } [pscustomobject]@{ Name = 'ThisPC' IconFile = 'this-pc.png' Title = 'This PC ikona' Description = 'Dodaje This PC ikonu na Desktop.' IconText = 'PC' AccentColor = $ColorCard Command = $ThisPCCommand ToolName = 'Ikonica' ColumnSpan = 1 } ) $LinkItems = @( [pscustomobject]@{ Name = 'ISODownlaod' IconFile = 'mas.png' Title = 'Download Windows / Office ISO' Description = 'ISO instalacije za Windows i Office.' IconText = 'L' AccentColor = $ColorCard Command = 'https://massgrave.dev/genuine-installation-media' ToolName = 'ISO' ColumnSpan = 2 ActionMode = 'link' } [pscustomobject]@{ Name = 'LinkMicrosoft' IconFile = 'link-microsoft.png' Title = 'Microsoft Learn' Description = 'Dokumentacija za Windows i PowerShell.' IconText = 'M' AccentColor = $ColorSecondary Command = 'https://learn.microsoft.com/' ToolName = 'Microsoft Learn' ColumnSpan = 1 ActionMode = 'link' } [pscustomobject]@{ Name = 'LinkPSGallery' IconFile = 'link-powershell-gallery.png' Title = 'PowerShell Gallery' Description = 'Moduli, skripte i paketi za PowerShell.' IconText = 'P' AccentColor = $ColorPurple Command = 'https://www.powershellgallery.com/' ToolName = 'PowerShell Gallery' ColumnSpan = 2 ActionMode = 'link' } ) # ============================================================ # GLAVNA FORMA # ============================================================ $Forma1 = [System.Windows.Forms.Form]::new() $Forma1.Name = 'WindowsToolbox' $Forma1.Text = 'Windows Toolbox' $Forma1.ClientSize = [System.Drawing.Size]::new(620, 930) $Forma1.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen $Forma1.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::None $Forma1.BackColor = $ColorBackground $Forma1.Font = [System.Drawing.Font]::new('Segoe UI', 10) $Forma1.ShowIcon = $false $Forma1.MaximizeBox = $false $Forma1.MinimizeBox = $true $Forma1.KeyPreview = $true # ============================================================ # GORNJA TRAKA # ============================================================ $TopBar = [System.Windows.Forms.Panel]::new() $TopBar.Location = [System.Drawing.Point]::new(0, 0) $TopBar.Size = [System.Drawing.Size]::new(620, 58) $TopBar.BackColor = $ColorTopBar $Forma1.Controls.Add($TopBar) $AccentLine = [System.Windows.Forms.Panel]::new() $AccentLine.Location = [System.Drawing.Point]::new(0, 0) $AccentLine.Size = [System.Drawing.Size]::new(6, 58) $AccentLine.BackColor = $ColorPrimary $TopBar.Controls.Add($AccentLine) $TitleLabel = [System.Windows.Forms.Label]::new() $TitleLabel.Text = 'Windows Toolbox by sokomm' $TitleLabel.Location = [System.Drawing.Point]::new(24, 8) $TitleLabel.Size = [System.Drawing.Size]::new(320, 25) $TitleLabel.Font = [System.Drawing.Font]::new('Segoe UI', 12, [System.Drawing.FontStyle]::Bold) $TitleLabel.ForeColor = $ColorText $TopBar.Controls.Add($TitleLabel) $SubtitleLabel = [System.Windows.Forms.Label]::new() $SubtitleLabel.Text = 'Administrativni alati , skripte i linkovi' $SubtitleLabel.Location = [System.Drawing.Point]::new(25, 33) $SubtitleLabel.Size = [System.Drawing.Size]::new(390, 18) $SubtitleLabel.Font = [System.Drawing.Font]::new('Segoe UI', 8.5) $SubtitleLabel.ForeColor = $ColorMuted $TopBar.Controls.Add($SubtitleLabel) $MinimizeButton = [System.Windows.Forms.Button]::new() $MinimizeButton.Text = '—' $MinimizeButton.Location = [System.Drawing.Point]::new(520, 0) $MinimizeButton.Size = [System.Drawing.Size]::new(50, 58) $MinimizeButton.FlatStyle = [System.Windows.Forms.FlatStyle]::Flat $MinimizeButton.FlatAppearance.BorderSize = 0 $MinimizeButton.FlatAppearance.MouseOverBackColor = [System.Drawing.ColorTranslator]::FromHtml('#26344D') $MinimizeButton.BackColor = $ColorTopBar $MinimizeButton.ForeColor = $ColorText $MinimizeButton.Font = [System.Drawing.Font]::new('Segoe UI', 12) $MinimizeButton.Cursor = [System.Windows.Forms.Cursors]::Hand $TopBar.Controls.Add($MinimizeButton) $CloseButton = [System.Windows.Forms.Button]::new() $CloseButton.Text = '×' $CloseButton.Location = [System.Drawing.Point]::new(570, 0) $CloseButton.Size = [System.Drawing.Size]::new(50, 58) $CloseButton.FlatStyle = [System.Windows.Forms.FlatStyle]::Flat $CloseButton.FlatAppearance.BorderSize = 0 $CloseButton.FlatAppearance.MouseOverBackColor = [System.Drawing.ColorTranslator]::FromHtml('#DC2626') $CloseButton.BackColor = $ColorTopBar $CloseButton.ForeColor = $ColorText $CloseButton.Font = [System.Drawing.Font]::new('Segoe UI', 16) $CloseButton.Cursor = [System.Windows.Forms.Cursors]::Hand $TopBar.Controls.Add($CloseButton) $MoveWindow = { [NativeMethods]::ReleaseCapture() | Out-Null [NativeMethods]::SendMessage($Forma1.Handle, 0xA1, [IntPtr]2, [IntPtr]0) | Out-Null } $TopBar.Add_MouseDown($MoveWindow) $TitleLabel.Add_MouseDown($MoveWindow) $SubtitleLabel.Add_MouseDown($MoveWindow) # ============================================================ # NASLOVI I SEKCIJE # ============================================================ $ToolsSectionLabel = [System.Windows.Forms.Label]::new() $ToolsSectionLabel.Text = 'Alati' $ToolsSectionLabel.Location = [System.Drawing.Point]::new(35, 60) $ToolsSectionLabel.Size = [System.Drawing.Size]::new(200, 24) $ToolsSectionLabel.ForeColor = $ColorText $ToolsSectionLabel.Font = [System.Drawing.Font]::new('Segoe UI', 12, [System.Drawing.FontStyle]::Bold) $Forma1.Controls.Add($ToolsSectionLabel) $ToolsDescription = [System.Windows.Forms.Label]::new() $ToolsDescription.Text = 'Internet alati za instalaciju, optimizaciju i udaljeni pristup.' $ToolsDescription.Location = [System.Drawing.Point]::new(35, 89) $ToolsDescription.Size = [System.Drawing.Size]::new(550, 24) $ToolsDescription.ForeColor = $ColorMuted $ToolsDescription.Font = [System.Drawing.Font]::new('Segoe UI', 9.1) $Forma1.Controls.Add($ToolsDescription) $ToolSection = Add-CardSection -Parent $Forma1 -Items $ToolItems -StartY 116 $ScriptsSectionLabel = [System.Windows.Forms.Label]::new() $ScriptsSectionLabel.Text = 'Skripte' $ScriptsSectionLabel.Location = [System.Drawing.Point]::new(35, $ToolSection.NextY - 2) $ScriptsSectionLabel.Size = [System.Drawing.Size]::new(220, 24) $ScriptsSectionLabel.ForeColor = $ColorText $ScriptsSectionLabel.Font = [System.Drawing.Font]::new('Segoe UI', 12, [System.Drawing.FontStyle]::Bold) $Forma1.Controls.Add($ScriptsSectionLabel) $ScriptsDescription = [System.Windows.Forms.Label]::new() $ScriptsDescription.Text = 'Kraće lokalne skripte i tweakovi sa proverama za Windows 11 gde je potrebno.' $ScriptsDescription.Location = [System.Drawing.Point]::new(35, $ToolSection.NextY + 22) $ScriptsDescription.Size = [System.Drawing.Size]::new(550, 24) $ScriptsDescription.ForeColor = $ColorMuted $ScriptsDescription.Font = [System.Drawing.Font]::new('Segoe UI', 9.1) $Forma1.Controls.Add($ScriptsDescription) $ScriptSection = Add-CardSection -Parent $Forma1 -Items $ScriptItems -StartY ($ToolSection.NextY + 50) $LinksSectionLabel = [System.Windows.Forms.Label]::new() $LinksSectionLabel.Text = 'Linkovi' $LinksSectionLabel.Location = [System.Drawing.Point]::new(35, $ScriptSection.NextY - 2) $LinksSectionLabel.Size = [System.Drawing.Size]::new(220, 24) $LinksSectionLabel.ForeColor = $ColorText $LinksSectionLabel.Font = [System.Drawing.Font]::new('Segoe UI', 12, [System.Drawing.FontStyle]::Bold) $Forma1.Controls.Add($LinksSectionLabel) $LinksDescription = [System.Windows.Forms.Label]::new() $LinksDescription.Text = 'Korisni linkovi koji se otvaraju direktno u browseru.' $LinksDescription.Location = [System.Drawing.Point]::new(35, $ScriptSection.NextY + 22) $LinksDescription.Size = [System.Drawing.Size]::new(550, 24) $LinksDescription.ForeColor = $ColorMuted $LinksDescription.Font = [System.Drawing.Font]::new('Segoe UI', 9.1) $Forma1.Controls.Add($LinksDescription) $LinkSection = Add-CardSection -Parent $Forma1 -Items $LinkItems -StartY ($ScriptSection.NextY + 50) $AllCards = [System.Collections.Generic.List[object]]::new() foreach ($card in $ToolSection.Cards) { [void]$AllCards.Add($card) } foreach ($card in $ScriptSection.Cards) { [void]$AllCards.Add($card) } foreach ($card in $LinkSection.Cards) { [void]$AllCards.Add($card) } # ============================================================ # STATUS I FOOTER # ============================================================ $StatusPanel = [System.Windows.Forms.Panel]::new() $StatusPanel.Location = [System.Drawing.Point]::new(35, $LinkSection.NextY + 8) $StatusPanel.Size = [System.Drawing.Size]::new(550, 45) $StatusPanel.BackColor = $ColorCard $Forma1.Controls.Add($StatusPanel) $StatusDot = [System.Windows.Forms.Label]::new() $StatusDot.Text = '●' $StatusDot.Location = [System.Drawing.Point]::new(16, 9) $StatusDot.Size = [System.Drawing.Size]::new(25, 25) $StatusDot.ForeColor = $ColorMuted $StatusDot.Font = [System.Drawing.Font]::new('Segoe UI', 12) $StatusPanel.Controls.Add($StatusDot) $StatusLabel = [System.Windows.Forms.Label]::new() $StatusLabel.Text = 'Spremno za pokretanje' $StatusLabel.Location = [System.Drawing.Point]::new(46, 12) $StatusLabel.Size = [System.Drawing.Size]::new(490, 24) $StatusLabel.ForeColor = $ColorMuted $StatusLabel.Font = [System.Drawing.Font]::new('Segoe UI', 10) $StatusPanel.Controls.Add($StatusLabel) $FooterLabel = [System.Windows.Forms.Label]::new() $FooterLabel.Text = 'Internet alati se preuzimaju online, a lokalne skripte se pokreću sa administratorskim pravima kada je potrebno.' $FooterLabel.Location = [System.Drawing.Point]::new(36, $LinkSection.NextY + 55) $FooterLabel.Size = [System.Drawing.Size]::new(550, 18) $FooterLabel.ForeColor = $ColorMuted $FooterLabel.Font = [System.Drawing.Font]::new('Segoe UI', 7.7) $Forma1.Controls.Add($FooterLabel) # ============================================================ # ZAOBLJENE IVICE # ============================================================ $Forma1.Add_Shown({ Set-RoundedRegion -Control $Forma1 -Radius 22 foreach ($card in $AllCards) { Set-RoundedRegion -Control $card.Panel -Radius 18 Set-RoundedRegion -Control $card.IconPanel -Radius 16 } Set-RoundedRegion -Control $StatusPanel -Radius 14 }) # ============================================================ # DOGAĐAJI # ============================================================ $MinimizeButton.Add_Click({ $Forma1.WindowState = [System.Windows.Forms.FormWindowState]::Minimized }) $CloseButton.Add_Click({ $Forma1.Close() }) $Forma1.Add_KeyDown({ param($sender, $eventArgs) if ($eventArgs.KeyCode -eq [System.Windows.Forms.Keys]::Escape) { $Forma1.Close() } }) # ============================================================ # PRIKAZ FORME # ============================================================ [void]$Forma1.ShowDialog() $Forma1.Dispose()