function showAbout($owner) { $form = New-Object System.Windows.Forms.Form $form.icon = $icon $form.Text = "Acerca de" $form.Width = 285 $form.Height = 265 $form.AutoSize = $true $form.MaximizeBox = $false $form.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterParent $form.Font = "Microsoft Sans Serif, 9.35" $form.FormBorderStyle = 'FixedDialog' $hidden = New-Object System.Windows.Forms.Button $hidden.Width = 0 $hidden.Height = 0 $form.Controls.Add($hidden) $logo = new-object Windows.Forms.PictureBox $logo.SizeMode = [System.Windows.Forms.PictureBoxSizeMode]::StretchImage $logo.Location = New-Object System.Drawing.Point(30, 20) $logo.Width = 32 $logo.Height = 32 $logo.Image = $icon $form.controls.add($logo) $label_name = New-Object System.Windows.Forms.Label $label_name.Text = $app_name $label_name.AutoSize = $true $label_name.Location = New-Object System.Drawing.Point(70, 30) $label_name.Font = [System.Drawing.Font]::new("Consolas", 13) $form.controls.add($label_name) $label_version = New-Object System.Windows.Forms.Label $label_version.Text = "Versión: $($metadata.version)" $label_version.AutoSize = $true $label_version.Location = New-Object System.Drawing.Point(40, 70) $label_version.Font = [System.Drawing.Font]::new("Consolas", 10) $form.controls.add($label_version) $label_date = New-Object System.Windows.Forms.Label $label_date.Text = "Fecha: $([datetime]::FromFileTime($metadata.date).ToString("yyyy-MM-dd HH:mm"))" $label_date.AutoSize = $true $label_date.Location = New-Object System.Drawing.Point(40, 95) $label_date.Font = [System.Drawing.Font]::new("Consolas", 10) $form.controls.add($label_date) $label_copy = New-Object System.Windows.Forms.Label $label_copy.Text = "Autor: $($metadata.author) © $([datetime]::FromFileTime($metadata.date).ToString("yyyy"))" $label_copy.AutoSize = $true $label_copy.Location = New-Object System.Drawing.Point(40, 120) $label_copy.Font = [System.Drawing.Font]::new("Consolas", 10) $form.controls.add($label_copy) $label_site = New-Object System.Windows.Forms.Label $label_site.Text = "Web:" $label_site.AutoSize = $true $label_site.Location = New-Object System.Drawing.Point(40, 145) $label_site.Font = [System.Drawing.Font]::new("Consolas", 10) $form.controls.add($label_site) $label_link = New-Object System.Windows.Forms.LinkLabel $label_link.Location = New-Object System.Drawing.Size(75, 145) $label_link.AutoSize = $true $label_link.LinkColor = "BLUE" $label_link.ActiveLinkColor = "RED" $label_link.Text = ($metadata.website -split "/")[2] $label_link.add_Click({[system.Diagnostics.Process]::start("$($metadata.website)")}) $label_link.Font = [System.Drawing.Font]::new("Consolas", 10) $form.Controls.Add($label_link) $btn_examine = New-Object System.Windows.Forms.Button $btn_examine.Text = "Examinar" $btn_examine.Location = New-Object System.Drawing.Point(32, 180) $btn_examine.Width = 97 $btn_examine.Height = 30 $btn_examine.Font = [System.Drawing.Font]::new("Consolas", 10) $btn_examine.Add_Click({ Invoke-Item $root }) $form.Controls.Add($btn_examine) $btn_update = New-Object System.Windows.Forms.Button $btn_update.Text = "Actualizar" $btn_update.Location = New-Object System.Drawing.Point(142, 180) $btn_update.Width = 97 $btn_update.Height = 30 $btn_update.Font = [System.Drawing.Font]::new("Consolas", 10) $btn_update.Add_Click({ Start-Process powershell -argument "$launcher -upd 1 -variant $($metadata.variant)" Stop-Process -Id $PID }) $form.Controls.Add($btn_update) $form.Add_Closing({ $form.Hide() }) [PSAppID]::SetAppIdForWindow($form.handle, "$($metadata.package).$app_name") $form.Add_LocationChanged({ $global:win_loc = $form.Location }) $form.Add_Resize({ $global:win_size = $form.Size }) $form.ShowDialog() }