This project is read-only.

Progress bar rather than spinning icon?

Topics: Archive - Deployment Scripts, Archive - General
Mar 23, 2015 at 6:00 PM
Hi Guys

Is there any way to customise PADT deployments to show a progress bar instead. I was considering using Write-Progress. Not sure if this would work or where to put it if I am honest.

Any chance this is possible?

Thanks in advance
NN
Mar 23, 2015 at 7:29 PM
NakedNuts wrote:
Hi Guys

Is there any way to customise PADT deployments to show a progress bar instead. I was considering using Write-Progress. Not sure if this would work or where to put it if I am honest.

Any chance this is possible?

Thanks in advance
NN
A marquee style progress indicator would be nice!

Yves.
Coordinator
Mar 24, 2015 at 11:10 PM
Technically yes this is feasible. However the progress dialog is written in Windows Presentation Format to achieve the multi threaded UI that runs in parallel to the installation. Adding an indeterminate progress bar is not as straight forward as one would think especially if you are familiar with Windows Forms as with WPF you need to write custom code to essentially animate the progress bar. If someone from the community wants to contribute the code for this we can look at including it but for now it would not be a priority.

Am 23.03.2015 um 17:00 schrieb NakedNuts <[email removed]>:

From: NakedNuts

Hi Guys

Is there any way to customise PADT deployments to show a progress bar instead. I was considering using Write-Progress. Not sure if this would work or where to put it if I am honest.

Any chance this is possible?

Thanks in advance
NN
Mar 25, 2015 at 10:21 AM
Thanks for the reply. I thought this may be more difficult than it seemed. Unfortunately I wont be able to help with the code although I would have been more than willing.
Mar 25, 2015 at 2:41 PM
PowerSheller wrote:
Technically yes this is feasible. However the progress dialog is written in Windows Presentation Format to achieve the multi threaded UI that runs in parallel to the installation. Adding an indeterminate progress bar is not as straight forward as one would think especially if you are familiar with Windows Forms as with WPF you need to write custom code to essentially animate the progress bar. If someone from the community wants to contribute the code for this we can look at including it but for now it would not be a priority. Am 23.03.2015 um 17:00 schrieb NakedNuts <[email removed]>: From: NakedNuts Hi Guys Is there any way to customise PADT deployments to show a progress bar instead. I was considering using Write-Progress. Not sure if this would work or where to put it if I am honest. Any chance this is possible? Thanks in advance NN
The PSADT leverages the "Ellipse" style progress indicator, the "Marquee" although different in appearance is similar in function in that it will spin as along as the "Function Show-InstallationProgress {}" is initialized. That said, how difficult would it be to modify "Function Show-InstallationProgress {}" to leverage a Marquee style progress indicator as opposed to Ellipse? The example below is from an Autoit based Deployment Toolkit (of sorts) which functions in the same capacity as the PSADT "Function Show-InstallationProgress {}".

MarqueeProgress
Coordinator
Mar 26, 2015 at 12:13 AM
I understand what is being requested here. Actually we had a progress bar originally, but the built-in WPF indeterminate (marquee) progress bar doesn't let you control the speed of the animation and we weren't quite happy with it - it goes at different speeds depending on the OS or .NET version (can't remember which).

Here is a mock-up so you can test it for yourself - I think you'll agree it's not quite as elegant or as smooth as the one you'd be familiar with from Windows forms - that was the reason we went with the ellipse instead. The ellipse is almost the standard for indeterminate progress indicators these days.

If you can code or source the code for a smoother animation than this (preferably in pure XAML), we can look to integrate it.
#Build the GUI
[xml]$xaml = @"
<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Name="Window" Title="Initial Window" WindowStartupLocation = "CenterScreen" 
    Width = "400" Height = "200" ShowInTaskbar = "True">
    <ProgressBar x:Name="progressBar1" IsIndeterminate="True" Maximum="100" Height="20" Width="300" /> 
</Window>
"@ 

$reader=(New-Object System.Xml.XmlNodeReader $xaml)
$Window=[Windows.Markup.XamlReader]::Load( $reader )

$Window.ShowDialog()

Apr 1, 2015 at 10:58 AM
PowerSheller wrote:
I understand what is being requested here. Actually we had a progress bar originally, but the built-in WPF indeterminate (marquee) progress bar doesn't let you control the speed of the animation and we weren't quite happy with it - it goes at different speeds depending on the OS or .NET version (can't remember which).

Here is a mock-up so you can test it for yourself - I think you'll agree it's not quite as elegant or as smooth as the one you'd be familiar with from Windows forms - that was the reason we went with the ellipse instead. The ellipse is almost the standard for indeterminate progress indicators these days.

If you can code or source the code for a smoother animation than this (preferably in pure XAML), we can look to integrate it.
#Build the GUI
[xml]$xaml = @"
<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Name="Window" Title="Initial Window" WindowStartupLocation = "CenterScreen" 
    Width = "400" Height = "200" ShowInTaskbar = "True">
    <ProgressBar x:Name="progressBar1" IsIndeterminate="True" Maximum="100" Height="20" Width="300" /> 
</Window>
"@ 

$reader=(New-Object System.Xml.XmlNodeReader $xaml)
$Window=[Windows.Markup.XamlReader]::Load( $reader )

$Window.ShowDialog()

With a little finagling I finally got it to work.
<Window

      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

      Name="Window" Title="" Background="WhiteSmoke"

      MaxHeight="224" MinHeight="224" Height="224"

      MaxWidth="449" MinWidth="449" Width="449" Padding="0,0,0,0" Margin="0,0,0,0"

      WindowStartupLocation = "Manual"

      Top=""

      Left=""

      TopMost=""

      ResizeMode="NoResize"

      Icon=""

      ShowInTaskbar="True" >

    <Window.Resources>

    <Storyboard x:Key="Storyboard1" RepeatBehavior="Forever"/>

    </Window.Resources>

    <Window.Triggers>

    <EventTrigger RoutedEvent="FrameworkElement.Loaded">

        <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>

    </EventTrigger>

    </Window.Triggers>

    <Grid >

    <Grid.RowDefinitions>

        <RowDefinition Height="Auto" />

        <RowDefinition Height="*" />

        <RowDefinition Height="Auto" />

    </Grid.RowDefinitions>

    <Label Padding="0" Grid.Row="0">

        <Label.Background>

        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">

            <GradientStop Color="#FF33CCFF" Offset="0" />

            <GradientStop Color="#FF333DFF" Offset="1" />

        </LinearGradientBrush>

        </Label.Background>

    </Label>

    <Image x:Name = "ProgressBanner" Grid.ColumnSpan="2" Margin="0,0,0,0" Source=""></Image>

    <TextBlock x:Name = "ProgressText" Grid.Row="1" Grid.Column="1" Margin="0,5,45,10" Text="" FontSize="15" FontFamily="Microsoft Sans Serif" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Padding="15" TextWrapping="Wrap"></TextBlock>

    <Grid Grid.Row="2" Margin="0,0,0,5">

        <Grid.ColumnDefinitions>

        <ColumnDefinition Width="1*" />

        <ColumnDefinition Width="2*" />

        <ColumnDefinition Width="1*" />

        </Grid.ColumnDefinitions>

        <ProgressBar Grid.Column="1" x:Name="progressBar1" IsIndeterminate="True" Margin="0,10,0,5" Maximum="100" Height="25" RenderTransformOrigin="0.493,3.8"/>

    </Grid>

    </Grid>

</Window>
I end up with the "Function Show-InstallationProgress {}" with a marquee progress bar instead of the Ellipse (below) After my modifications to the xaml code above.

Marquee Progress
Coordinator
Apr 1, 2015 at 11:14 AM
Looks good - nice work. We will review for inclusion in the next release (won't make it in to 3.6.1).