Jump to content
Sign in to follow this  
Noxeterna

Trying to automate PDFCreator installation

Recommended Posts

Noxeterna

Good day,

First off i'm pretty new to AutoIt so please bear with me on this. I've been working on a script to automate the PDFCreator webinstaller installation. I get to the end fine but once it actually triggers the last part of the install (while the green progress bar is showing) the script is already ended, thus it cant sent the ("!f") to end the installation. Here is my script. Any and all help is much appreciated. Its like the script is running too fast ? Not too sure. But willing to learn :)

Run("PDFCreatorWebSetup.exe")
WinWait("Select Setup Language")
ControlClick("Select Setup Language","OK","TNewButton1")
WinWait("Setup - PDFCreator WebSetup")
ControlClick("Setup - PDFCreator WebSetup","Download","TNewButton1")
WinWait("Select Setup Language")
ControlClick("Select Setup Language","OK","TNewButton1")
WinWaitActive("Setup - PDFCreator")
Send("!n")
WinWaitActive("Setup - PDFCreator")
Send("!a")
Send("!n")
WinWaitActive("Setup - PDFCreator")
Send("!n")
WinWait("Setup - PDFCreator")
ControlClick("Setup - PDFCreator","Custom Installation","TNewRadioButton1")
Sleep(1000)
ControlClick("Setup - PDFCreator","Next >","TNewButton2")
Sleep(500)
WinWait("Setup - PDFCreator")
Sleep(500)
ControlClick("Setup - PDFCreator","Install","TNewButton2")
WinWaitActive("Setup - PDFCreator")
sleep(500)
Send("!f")

Thank you very much for your time.

-Marc André Leclerc-

Share this post


Link to post
Share on other sites
water

Welcome to AutoIt and the forum!

I think there is an easier way: PDFCreator has a silent instalaltion option. Check this website.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
JLogan3o13

Hi, Noxeterna. Is there any reason you cannot use the silent install?

PDFCreator-1_2_3_setup.exe /verysilent /f /norestart

If you need more options, you can use the /SAVEINF="<PATH>" option to create an inf file for your installation. Take a look here for more:

http://www.itninja.com/software/open-source-1/pdfcreator-1/1-7765

Edit: Dang too slow :)

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Noxeterna

First of all, thanks to both of you for the swift responses. I have tried your solution JLogan and it worked...I tried finding the silent switches on a web installer with Universal switch finder but it would not come up with anything, so i downloaded the full package and found valid switches which i could use in a ''Run'' command. Also im not too too familiar with the /SAVEINF="<PATH>" option you mentioned i will have to look it up. What i am basically trying to achieve is making a dvd i can put all my software on and run the script to install all of them unattended so i can work on other things. Hopefully i'll have it all up and operational next week. I would try for a gui with checkboxes (so i can toggle what to install or all ) but since im pretty new i want to try for something simple at first...then i can try to wrap my brain around GUI codes. Thanks again. I'll probably have more questions along the way. Loving AutoIt and i expect ill be using it a lot as of now :)

Share this post


Link to post
Share on other sites
water

We will be glad to help you with your questions.

I can't remember where I found it but I think there was a thread about some kind of universal installer some time ago. It allowed to define the products to be installed in an INI file.

If I find something I will post the link here.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
careca

Check on the bottom posts for a gui with checkboxes.

Should be easy to understand, if not, we're here.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
water

Here are a few links to ready made softer installer scripts:

by abberration

by TheSaint (Maybe not exactly what you are looking for)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Noxeterna

Wow, once again thanks for the prompt help. I tried setting up the Software installer by Abberation. I made the proper folder and file structure, setup the ini file. But once i launch the the script i get an error at line 97:

==> Array variable subscript badly formatted.:

ReDim $array[$i]

Ill re-include the code so you can see for yourselves: (Lines 84-97)

Func _Populate()
    ; Find all files in the Software folder and populate the tabs with the installers.
    $f = FileFindFirstFile("Software/*.*")
    Dim $array[1]
    $i = 0
    Do
        $s = FileFindNextFile($f)
        If Not @error Then
            $array[$i] = $s
            $i += 1
            ReDim $array[$i + 1]
        EndIf
    Until @error
    ReDim $array[$i]

I think i will need way more reading up. This Code is exactly what im looking for. I checked the redim function help and could not figure out what was wrong with it. I guess ill lookup more on it and try to make sense of all this. GUI is a tad way too advance for me still. Thanks once more for all the help provided. Really appreciated.

-Marc-Andre Leclerc-

Share this post


Link to post
Share on other sites
water

This error happens as long as subfolder "Software" is empty.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Noxeterna

Once again i am in your debt :) This works wonders. Thanks you so very much for this. I was wondering if you might be able to suggest very basic GUI tutorials that i can work on over the weekend to try and make more sense of this ? If not its no biggy i'll google-fu it. Once again, thanks to all who responded on this. You guys rock :)

-Marc-Andre Leclerc-

Share this post


Link to post
Share on other sites
water

The wiki has wonderfull tutorials about (nearly) every aspect of AutoIt.

Start here.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
BrewManNH

I would replace the section where that code redims the array with something more along the lines of this:

Func _Populate()
     ; Find all files in the Software folder and populate the tabs with the installers.
     $f = FileFindFirstFile("Software*.*")
     Local $array[10] = ["0"]
     $i = 1
     Do
          $s = FileFindNextFile($f)
          If Not @error Then
               $array[0] = $i ; This stores how many items were found in the 0 element of the array
               $array[$i] = $s
               $i += 1
               If UBound($array) <= $i Then ; this only redims the array if $i is = or > than the size of the array
                    ReDim $array[$array[0] * 10] ; this redims the array to be 10 times it's previous size to hold more items
               EndIf
          EndIf
     Until @error
     ReDim $array[$i] ; this redims the array down to just how many items were found in the search.
EndFunc   ;==>_Populate

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
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
Sign in to follow this  

×