Jump to content

Recommended Posts

Posted (edited)
I want to make a code to automatically execute the installation of certain programs, it's almost ready, only that when executing the installation the CMD sales are shown and I want them to be hidden and I've already tried many options in forums but they don't work for me I don't have Any idea that I may be doing wrong, could you help me please?
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>
#RequireAdmin



Global $FileChrome =
Global $FileAdobe =
Global $FileDropbox =
Global $FileOffice =
Global $FileIso = UltraISO\UltraISO.exe /?

Dim $Ini, $fin, $VPinc, $Progress1


IniA ()



Func IniA ()
$VPinc = GUICreate("Instalacion de Programas", 401, 437, -1, -1)
GUISetBkColor(0x000000)
$Ini = GUICtrlCreateButton("Instalar Programas", 100, 16, 200, 30, $BS_MULTILINE)
GUICtrlSetFont(-1, 12, 800, 2, "Times New Roman")
GUICtrlSetCursor (-1, 0)
$Label2 = GUICtrlCreateLabel("Precione ESC para Salir", 120, 399, 160, 22)
GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman")
GUICtrlSetColor(-1, 0x34EB41)
$Label1 = GUICtrlCreateLabel("Google Chrome", 16, 72, 112, 22)
GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman")
GUICtrlSetColor(-1, 0x34EB41)
$Label3 = GUICtrlCreateLabel("Adobe Acrobat  DC", 16, 102, 128, 22)
GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman")
GUICtrlSetColor(-1, 0x34EB41)
$Label4 = GUICtrlCreateLabel("Dropbox", 16, 132, 64, 22)
GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman")
GUICtrlSetColor(-1, 0x34EB41)
$Label5 = GUICtrlCreateLabel("Microsoft Office 2013", 16, 162, 144, 22)
GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman")
GUICtrlSetColor(-1, 0x34EB41)
$Label6 = GUICtrlCreateLabel("Ultra ISO", 16, 192, 72, 22)
GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman")
GUICtrlSetColor(-1, 0x34EB41)

$Progress1 = GUICtrlCreateProgress(32, 360, 337, 25)
GUICtrlSetColor(-1, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUISetState()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Ini
            RunWait('"' & @ComSpec & ' /c "' & $FileChrome & '"', @SW_HIDE)
            _SendMessage(GUICtrlGetHandle($Progress1), 20)
            Sleep (100)
            GUICtrlSetData(-1, 20)

            RunWait('"' & @ComSpec & ' /c "' & $FileAdobe & '"', @SW_HIDE)
            _SendMessage(GUICtrlGetHandle($Progress1), 40)
            Sleep (100)
            GUICtrlSetData(-1, 40)

            RunWait('"' & @ComSpec & ' /c "' & $FileDropbox & '"', @SW_HIDE)
            _SendMessage(GUICtrlGetHandle($Progress1), 60)
            Sleep (100)
            GUICtrlSetData(-1, 60)

            RunWait('"' & @ComSpec & ' /c "' & $FileOffice & '"', @SW_HIDE)
            _SendMessage(GUICtrlGetHandle($Progress1), 80)
            Sleep (100)
            GUICtrlSetData(-1, 80)

            RunWait('"' & @ComSpec & ' /c "' & $FileIso & '"', @SW_HIDE)
            _SendMessage(GUICtrlGetHandle($Progress1), 100)
            Sleep (100)
            GUICtrlSetData(-1, 100)
            GUISetState(@SW_SHOW,$VPinc)


    EndSwitch
WEnd
EndFunc

 

Edited by Hemrry
  • Developers
Posted
6 hours ago, Hemrry said:
Global $FileIso = UltraISO\UltraISO.exe /?

This code won't run ...right?

Normally one would use the silent install option of the product installer which often is /S 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted
8 minutes ago, Jos said:

Este código no se ejecutará ... ¿Derecha?

Normalmente se usaría la opción de instalación silenciosa del instalador del producto, que a menudo es /S

Thank you very much, yes I know, I just put it like this to have it as a test and see the execution window

  • Developers
Posted

Then I am lost on what you are asking us...  maybe you can try to explain when you want to see and what you want to suppress?

PS: Please do not add an other language quotes in your answers and stick to English only. Also only quote text when it would else be unclear what you are responding to, else just port the response only. ;) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Ok, the only thing I don't want is for the cmd window to not be displayed when running UltraISO\UltraISO.exe /s , when the While is executed, all cmd windows are displayed even though I'm set @SW_HIDE to hide the sale that's what I mean and excuse me

Posted (edited)

Sorry, I don't know if I'm doing it wrong but I already tried anyway and it still shows the cmd window for like 1 second and it disappears

Edited by Hemrry
  • Solution
Posted

Listen well, this is basic stuff, you need to be able to solve this simple problem by yourself.  Reduce your script to the bare minimum to reproduce the problem.  Add some error handling and log every line of your script.

If after all you cannot solve it on your own, then post something that everyone can run.

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
  • Recently Browsing   0 members

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