Jump to content

Installer screen


Aldrinn
 Share

Recommended Posts

  • Moderators

Aldrinn,

How do you get the progress information from your installers?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Aldrinn,

How do you get the progress information from your installers?

M23

From the installers.

But for the customers is it nicer that everything is in 1 screen.

Have a look at ProgressOn(), ProgressOff() and ProgressSet(). These built-in functions maybe what you want.

Look at these functions and then see what you can achieve. Otherwise, I am sure something can be done to help you.

And how must my script look like than?

Aldrinn

Link to comment
Share on other sites

  • Moderators

Aldrinn,

Here is an idea of how you might do it - I have had to simulate quite a lot, but I hope you get the idea: :mellow:

#include <GUIConstantsEx.au3>

Global $aInstall_List[6] = ["One", "Two", "Three", "Four", "Five", "Six"]

$hGUI = GUICreate("Test", 500, 500)

GUICtrlCreateLabel("Current installer", 10, 20, 100, 20)
$hLabel_1 = GUICtrlCreateLabel("", 120, 20, 100, 20)
$hProgress_1 = GUICtrlCreateProgress(10, 50, 480, 20)
GUICtrlCreateLabel("Total installed", 10, 100, 100, 20)
$hProgress_2 = GUICtrlCreateProgress(10, 130, 480, 20)
GUISetState()

For $i = 0 To UBound($aInstall_List)

    ; Simulate running install
    GUICtrlSetData($hLabel_1, $aInstall_List[$i])

    ; Simulate waiting until install completes - probably by using something like: While ProcessExists("One.exe")
    $j = 0
    Do
        ; You would read $j from your installer
        GUICtrlSetData($hProgress_1, $j)
        GUICtrlSetData($hProgress_2, ($i * 100 / UBound($aInstall_List)) + ($j / 6))
        $j += 1
        Sleep(100)
    Until $j = 100
Next

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Aldrinn,

Here is an idea of how you might do it - I have had to simulate quite a lot, but I hope you get the idea: :mellow:

#include <GUIConstantsEx.au3>

Global $aInstall_List[6] = ["One", "Two", "Three", "Four", "Five", "Six"]

$hGUI = GUICreate("Test", 500, 500)

GUICtrlCreateLabel("Current installer", 10, 20, 100, 20)
$hLabel_1 = GUICtrlCreateLabel("", 120, 20, 100, 20)
$hProgress_1 = GUICtrlCreateProgress(10, 50, 480, 20)
GUICtrlCreateLabel("Total installed", 10, 100, 100, 20)
$hProgress_2 = GUICtrlCreateProgress(10, 130, 480, 20)
GUISetState()

For $i = 0 To UBound($aInstall_List)

    ; Simulate running install
    GUICtrlSetData($hLabel_1, $aInstall_List[$i])

    ; Simulate waiting until install completes - probably by using something like: While ProcessExists("One.exe")
    $j = 0
    Do
        ; You would read $j from your installer
        GUICtrlSetData($hProgress_1, $j)
        GUICtrlSetData($hProgress_2, ($i * 100 / UBound($aInstall_List)) + ($j / 6))
        $j += 1
        Sleep(100)
    Until $j = 100
Next

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

M23

Yes that what i expected.

But now the final question how can i include this:

RunWait ("\\brainnas1\software\autoit\installers\diskdefrag.exe" )

RunWait ("\\brainnas1\software\autoit\installers\foxit.exe")

RunWait ("\\brainnas1\software\autoit\installers\realvnc 4.1.3.exe")

RunWait ("\\brainnas1\software\autoit\installers\TuneUp.exe")

RunWait ("\\brainnas1\software\autoit\installers\java 6.18.exe")

RunWait ("\\brainnas1\software\autoit\installers\malware.exe")

Because this is what he needs to instal.

Aldrinn

Link to comment
Share on other sites

  • Moderators

Aldrinn,

If you use RunWait, how are you going to get the progress state of the installers? Your script will be paused until the installer finishes. :(

That is why I asked you how you were going to do this in my previous post! :mellow:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

And how must my script look like than?

Here. A simple script to start with. I comment the RunWait() lines for testing the script. The Sleep()s are to show the progress increments for the test only.

ProgressOn('Installations in progress', 'main', 'sub')
ProgressSet(10, 'Installing', 'diskdefrag.exe')
;~ RunWait ("\\brainnas1\software\autoit\installers\diskdefrag.exe" )
Sleep(1000)
ProgressSet(10, 'Installing', 'foxit.exe')
;~ RunWait ("\\brainnas1\software\autoit\installers\foxit.exe")
ProgressSet(15, 'Installing', 'realvnc 4.1.3.exe')
Sleep(1000)
;~ RunWait ("\\brainnas1\software\autoit\installers\realvnc 4.1.3.exe")
ProgressSet(20, 'Installing', 'TuneUp.exe')
Sleep(1000)
;~ RunWait ("\\brainnas1\software\autoit\installers\TuneUp.exe")
ProgressSet(40, 'Installing', 'java 6.18.exe')
Sleep(1000)
;~ RunWait ("\\brainnas1\software\autoit\installers\java 6.18.exe")
ProgressSet(60, 'Installing', 'malware.exe')
Sleep(1000)
;~ RunWait ("\\brainnas1\software\autoit\installers\malware.exe")
ProgressSet(80, 'Installation Complete', '')
Sleep(1000)
ProgressOff()
Link to comment
Share on other sites

  • Moderators

Aldrinn,

If you run your installers using RunWait, the script pauses until the installer has finished, so there is no way to update the "Current Installer" progress bar. In my earlier post I asked you how you got this information because how you determine the progress of each installer is fundamental to how you update the progress bar. You replied that you could get this information from your installers - but it now seems that you have no way of doing this. :(

However, I can suggest a partial solution - use a Marquee progress like this to at least indicate that something is going on: :mellow:

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>

Global $aInstall_List[6] = ["One", "Two", "Three", "Four", "Five", "Six"]

$hGUI = GUICreate("Test", 500, 500)

GUICtrlCreateLabel("Current installer", 10, 20, 100, 20)
$hLabel_1 = GUICtrlCreateLabel("", 120, 20, 100, 20)
$hProgress_1 = GUICtrlCreateProgress(10, 50, 480, 20, $PBS_MARQUEE)
GUICtrlCreateLabel("Total installed", 10, 100, 100, 20)
$hProgress_2 = GUICtrlCreateProgress(10, 130, 480, 20)
GUISetState()

For $i = 0 To UBound($aInstall_List) - 1

    ; Start the top progress going
    _SendMessage(GUICtrlGetHandle($hProgress_1), $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms

    ; Simulate running install
    GUICtrlSetData($hLabel_1, $aInstall_List[$i])

    ; Simulate waiting until install completes - probably by using something like: While ProcessExists("One.exe")

    Sleep(5000)

    ; Update bottom progress
    GUICtrlSetData($hProgress_2, ($i + 1) * (100 / UBound($aInstall_List)))

Next

; Stop the top progress
_SendMessage(GUICtrlGetHandle($hProgress_1), $PBM_SETMARQUEE, False, 50)
GUICtrlSetData($hLabel_1, "")

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...