Powershell Application Deployment Toolkit
hi all,
i know isn`t directly microsoft question since guys have been helpful , i`m having no luck on forums associated tool thought ask here, appreciated.
i`m using psappdeployment toolkit sccm deploy applications end users, has been working need customise welcome message remove "continue" button clicking won`t such.
is there way can remove "continue" button? i`ve hashed out "continue" button box still shows of box next "close programs" isn`t huge problem looks unprofessional.
thanks in advance,
scott
## form $formwelcome.controls.add($picturebanner) $formwelcome.controls.add($buttonabort) ##---------------------------------------------- ## create padding object $paddingnone = new-object -typename 'system.windows.forms.padding' $paddingnone.top = 0 $paddingnone.bottom = 0 $paddingnone.left = 0 $paddingnone.right = 0 ## generic label properties $labelpadding = '20,0,20,0' ## generic button properties $buttonwidth = 110 $buttonheight = 23 $buttonpadding = 50 $buttonsize = new-object -typename 'system.drawing.size' $buttonsize.width = $buttonwidth $buttonsize.height = $buttonheight $buttonpadding = new-object -typename 'system.windows.forms.padding' $buttonpadding.top = 0 $buttonpadding.bottom = 5 $buttonpadding.left = 50 $buttonpadding.right = 0 ## picture banner $picturebanner.databindings.defaultdatasourceupdatemode = 0 $picturebanner.imagelocation = $appdeploylogobanner $system_drawing_point = new-object -typename 'system.drawing.point' $system_drawing_point.x = 0 $system_drawing_point.y = 0 $picturebanner.location = $system_drawing_point $picturebanner.name = 'picturebanner' $system_drawing_size = new-object -typename 'system.drawing.size' $system_drawing_size.height = 50 $system_drawing_size.width = 450 $picturebanner.size = $system_drawing_size $picturebanner.sizemode = 'centerimage' $picturebanner.margin = $paddingnone $picturebanner.tabindex = 0 $picturebanner.tabstop = $false ## label app name $labelappname.databindings.defaultdatasourceupdatemode = 0 $labelappname.name = 'labelappname' $system_drawing_size = new-object -typename 'system.drawing.size' if (-not $showcloseapps) { $system_drawing_size.height = 40 } else { $system_drawing_size.height = 65 } $system_drawing_size.width = 450 $labelappname.size = $system_drawing_size $system_drawing_size.height = 0 $labelappname.maximumsize = $system_drawing_size $labelappname.margin = '0,15,0,15' $labelappname.padding = $labelpadding $labelappname.tabindex = 1 ## initial form layout: close applications / allow deferral if ($showcloseapps) { $labelappnametext = $configclosepromptmessage } elseif (($showdefer) -or ($forcecountdown)) { $labelappnametext = "$configdeferpromptwelcomemessage `n$installtitle" } if ($customtext) { $labelappnametext = "$labelappnametext `n`n$configwelcomepromptcustommessage" } $labelappname.text = $labelappnametext $labelappname.textalign = 'topcenter' $labelappname.anchor = 'top' $labelappname.autosize = $true $labelappname.add_click($handler_labelappname_click) ## listbox close applications $listboxcloseapps.databindings.defaultdatasourceupdatemode = 0 $listboxcloseapps.formattingenabled = $true $listboxcloseapps.horizontalscrollbar = $true $listboxcloseapps.name = 'listboxcloseapps' $system_drawing_size = new-object -typename 'system.drawing.size' $system_drawing_size.height = 100 $system_drawing_size.width = 300 $listboxcloseapps.size = $system_drawing_size $listboxcloseapps.margin = '75,0,0,0' $listboxcloseapps.tabindex = 3 $processdescriptions | foreach-object { $null = $listboxcloseapps.items.add($_) } ## label defer $labeldefer.databindings.defaultdatasourceupdatemode = 0 $labeldefer.name = 'labeldefer' $system_drawing_size = new-object -typename 'system.drawing.size' $system_drawing_size.height = 90 $system_drawing_size.width = 450 $labeldefer.size = $system_drawing_size $system_drawing_size.height = 0 $labeldefer.maximumsize = $system_drawing_size $labeldefer.margin = $paddingnone $labeldefer.padding = $labelpadding $labeldefer.tabindex = 4 $deferraltext = "$configdeferpromptexpirymessage`n" if ($defertimes -ge 0) { $deferraltext = "$deferraltext `n$configdeferpromptremainingdeferrals $([int32]$defertimes + 1)" } if ($deferdeadline) { $deferraltext = "$deferraltext `n$configdeferpromptdeadline $deferdeadline" } if (($defertimes -lt 0) -and (-not $deferdeadline)) { $deferraltext = "$deferraltext `n$configdeferpromptnodeadline" } $deferraltext = "$deferraltext `n`n$configdeferpromptwarningmessage" $labeldefer.text = $deferraltext $labeldefer.textalign = 'middlecenter' $labeldefer.autosize = $true $labeldefer.add_click($handler_labeldefer_click) ## label countdown $labelcountdown.databindings.defaultdatasourceupdatemode = 0 $labelcountdown.name = 'labelcountdown' $system_drawing_size = new-object -typename 'system.drawing.size' $system_drawing_size.height = 40 $system_drawing_size.width = 450 $labelcountdown.size = $system_drawing_size $system_drawing_size.height = 0 $labelcountdown.maximumsize = $system_drawing_size $labelcountdown.margin = $paddingnone $labelcountdown.padding = $labelpadding $labelcountdown.tabindex = 4 $labelcountdown.font = 'microsoft sans serif, 9pt, style=bold' $labelcountdown.text = '00:00:00' $labelcountdown.textalign = 'middlecenter' $labelcountdown.autosize = $true $labelcountdown.add_click($handler_labeldefer_click) ## panel flow layout $system_drawing_point = new-object -typename 'system.drawing.point' $system_drawing_point.x = 0 $system_drawing_point.y = 50 $flowlayoutpanel.location = $system_drawing_point $flowlayoutpanel.autosize = $true $flowlayoutpanel.anchor = 'top' $flowlayoutpanel.flowdirection = 'topdown' $flowlayoutpanel.wrapcontents = $true $flowlayoutpanel.controls.add($labelappname) if ($showcloseapps) { $flowlayoutpanel.controls.add($listboxcloseapps) } if ($showdefer) { $flowlayoutpanel.controls.add($labeldefer) } if ($showcountdown) { $flowlayoutpanel.controls.add($labelcountdown) } ## button close me $buttoncloseapps.databindings.defaultdatasourceupdatemode = 0 $buttoncloseapps.location = '15,0' $buttoncloseapps.name = 'buttoncloseapps' $buttoncloseapps.size = $buttonsize $buttoncloseapps.tabindex = 5 $buttoncloseapps.text = $configclosepromptbuttonclose $buttoncloseapps.dialogresult = 'yes' $buttoncloseapps.autosize = $true $buttoncloseapps.usevisualstylebackcolor = $true $buttoncloseapps.add_click($buttoncloseapps_onclick) ## button defer $buttondefer.databindings.defaultdatasourceupdatemode = 0 if (-not $showcloseapps) { $buttondefer.location = '15,0' } else { $buttondefer.location = '170,0' } $buttondefer.name = 'buttondefer' $buttondefer.size = $buttonsize $buttondefer.tabindex = 6 $buttondefer.text = $configclosepromptbuttondefer $buttondefer.dialogresult = 'no' $buttondefer.autosize = $true $buttondefer.usevisualstylebackcolor = $true $buttondefer.add_click($buttondefer_onclick) ## button continue ##$buttoncontinue.databindings.defaultdatasourceupdatemode = 0 ##$buttoncontinue.location = '325,0' ##$buttoncontinue.name = 'buttoncontinue' ##$buttoncontinue.size = $buttonsize ##$buttoncontinue.tabindex = 7 ##$buttoncontinue.text = $configclosepromptbuttoncontinue ##$buttoncontinue.dialogresult = 'ok' ##$buttoncontinue.autosize = $true ##$buttoncontinue.usevisualstylebackcolor = $true ##$buttoncontinue.add_click($buttoncontinue_onclick) #if ($showcloseapps) { # add tooltip continue button ##$tooltip.backcolor = [drawing.color]::lightgoldenrodyellow ##$tooltip.isballoon = $false ##$tooltip.initialdelay = 100 ##$tooltip.reshowdelay = 100 ##$tooltip.settooltip($buttoncontinue, $configclosepromptbuttoncontinuetooltip) ##} ## button abort (hidden) $buttonabort.databindings.defaultdatasourceupdatemode = 0 $buttonabort.name = 'buttonabort' $buttonabort.size = '1,1' $buttonabort.tabstop = $false $buttonabort.dialogresult = 'abort' $buttonabort.tabindex = 5 $buttonabort.usevisualstylebackcolor = $true $buttonabort.add_click($buttonabort_onclick) ## form welcome $system_drawing_size = new-object -typename 'system.drawing.size' $system_drawing_size.height = 0 $system_drawing_size.width = 0 $formwelcome.size = $system_drawing_size $formwelcome.padding = $paddingnone $formwelcome.margin = $paddingnone $formwelcome.databindings.defaultdatasourceupdatemode = 0 $formwelcome.name = 'welcomeform' $formwelcome.text = $installtitle $formwelcome.startposition = 'centerscreen' $formwelcome.formborderstyle = 'fixeddialog' $formwelcome.maximizebox = $false $formwelcome.minimizebox = $false $formwelcome.topmost = $topmost $formwelcome.toplevel = $true $formwelcome.icon = new-object -typename 'system.drawing.icon' -argumentlist $appdeploylogoicon $formwelcome.autosize = $true $formwelcome.controls.add($picturebanner) $formwelcome.controls.add($flowlayoutpanel) ## panel button $system_drawing_point = new-object -typename 'system.drawing.point' $system_drawing_point.x = 0 # calculate position of panel relative size of form $system_drawing_point.y = (($formwelcome.size | select-object -expandproperty 'height') - 10) $panelbuttons.location = $system_drawing_point $system_drawing_size = new-object -typename 'system.drawing.size' $system_drawing_size.height = 40 $system_drawing_size.width = 450 $panelbuttons.size = $system_drawing_size $panelbuttons.autosize = $true $panelbuttons.anchor = 'top' $padding = new-object -typename 'system.windows.forms.padding' $padding.top = 0 $padding.bottom = 0 $padding.left = 0 $padding.right = 0 $panelbuttons.margin = $padding if ($showcloseapps) { $panelbuttons.controls.add($buttoncloseapps) } if ($showdefer) { $panelbuttons.controls.add($buttondefer) } $panelbuttons.controls.add($buttoncontinue) ## add buttons panel form $formwelcome.controls.add($panelbuttons) ## save initial state of form $formwelcomewindowstate = $formwelcome.windowstate # init onload event correct initial state of form $formwelcome.add_load($form_statecorrection_load) # clean control events $formwelcome.add_formclosed($form_cleanup_formclosed) function refresh-installationwelcome { $formwelcome.bringtofront() $formwelcome.location = "$($formwelcomestartposition.x),$($formwelcomestartposition.y)" $formwelcome.refresh() } ## minimize other windows if ($minimizewindows) { $null = $shellapp.minimizeall() } ## show form $result = $formwelcome.showdialog() $formwelcome.dispose()
.
you have use name of button trying hid.
\_(ツ)_/
Windows Server > Windows PowerShell
Comments
Post a Comment