Jump to content

Recommended Posts

  • 1 month later...
Posted

is it possible to place the *.exe in the folders? for example, some programs require different files that can be reproduced (eg some files *. ini)?

That could be done so that every program was in a separate file in the software?

eg

AdobeReader -> Software1

FineReader -> Software2

etc.?

Posted (edited)

From playing with it i came up with this for 64/32 bit

I added an extra line to the .ini file for each product like this

[install_adobe.exe]

Desc=Adobe Reader X

switch= /sPB /rs /rps

Category=1

Arch=3264

Arch =

either

32 (32 bit installers)

or

64 (64 bit installers)

or

3264 (32 &64 bit installers in one file)

And changed the function populate like this, which appears to work

Func _Populate()
$OsArch = @OSArch
; 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]

Select
Case $OsArch = "X64"
For $i = 1 To UBound($array) Step 1
$category = IniRead($iniFile, $array[$i - 1], "Category", "6")
$desc = IniRead($iniFile, $array[$i - 1], "Desc", "")
$IniArch = IniRead($iniFile, $array[$i - 1], "Arch", "")
If $category = 1 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView1)
ElseIf $category = 2 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView2)
ElseIf $category = 3 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView3)
ElseIf $category = 4 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView4)
ElseIf $category = 5 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView5)
ElseIf $category = 6 And $IniArch > 32 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView6)
Else
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView7)
EndIf
Next
Case $OsArch = "X86"
For $i = 1 To UBound($array) Step 1
$category = IniRead($iniFile, $array[$i - 1], "Category", "6")
$desc = IniRead($iniFile, $array[$i - 1], "Desc", "")
$IniArch = IniRead($iniFile, $array[$i - 1], "Arch", "")
If $category = 1 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView1)
ElseIf $category = 2 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView2)
ElseIf $category = 3 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView3)
ElseIf $category = 4 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView4)
ElseIf $category = 5 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView5)
ElseIf $category = 6 And $IniArch <> 64 Then
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView6)
Else
GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView7)
EndIf
Next
EndSelect
EndFunc ;==>_Populate

The only downside with this method is you have to add the Arch for each product.

But im sure there are many other ways

Edited by Chimaera
Posted

I get an Error:

...installer.au3 (108) : ==> Variable used without being declared.:

GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, $ListView7)

GUICtrlCreateListViewItem($array[$i - 1] & "|" & $desc, ^ ERROR

when trying to execute/compile your script

Posted

thanks for shering.

little fix.

if the software folder is empty your code crash with this error:

Software Installer.au3 (86) : ==> Array variable subscript badly formatted.:

ReDim $array[$i]

ReDim $array[^ ERROR

to fix that add this line before line 86:

if $i = 0 Then Return 0

thanks again

  • 1 month later...
Posted (edited)

Is it possible to use this for some installation without silent switch?

Yes just omit the switch in the ini file

[install_adobe.exe]
Desc=Adobe Reader X
switch= /sPB /rs /rps ;==> becomes switch=
Category=1

it will still check but there is nothing to add

Edited by Chimaera
  • 1 month later...
Posted (edited)

Hi, i was wondering two things:

1) is it possible to check for software in multiple location?

2) is it possible to check for software published to a ftp path?

BTW: This is an awesome script :)

Edited by Copyrigth
Posted

I cannot get it to read the config.ini?

any help greatly appreciated..

I hadd the same problem, but when i added "." before the path it worked. (for me, atleast)
Posted

Maybe I'am to stupid or there is a wrong default on my pc.

There are many missing backslashes or am I wrong?

Global $iniFile = @ScriptDir & "Config.ini"

Run("msiexec /i " & '"' & $scriptDir & "Software" & $fileName & '" ' & $switch)

RunWait('"' & $scriptDir & "Software" & $fileName & '"' & " " & $switch)
Posted

It's more than likely the forum software ate the backslashes when the script was posted or edited. Unfortunately it's a too common experience, so you'll have to reinsert them where they belong.

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

  • Moderators
Posted

habib64,

First, welcome to the AutoIt forum. :)

I suggest you post your code - and the associated ini file - so that we can see where you might have gone wrong. When you post your script please use Code tags - put [autoit] before and [/autoit] after your posted code. Then you get a scrolling box and syntax colouring which makes it easier to read. :)

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

 

Posted

Run("msiexec /i " & '"' & $scriptDir & "Software" & $fileName & '" ' & $switch) ; For MSI type installers

RunWait('"' & $scriptDir & "Software" & $fileName & '"' & " " & $switch) ; For EXE installers

These 2 lines don't seem to work as written, when executed a box just flashes real fast and nothing happens.

Can anybody see whats wrong with this, stumped.

Posted

SWB,

There is nothing wrog there if your files is in a katalog kalled "Software" in the same katalog you run the script from.

If that is the case try posting the hole function :)

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
×
×
  • Create New...