Jump to content


Photo

Using AutoIt for silent install


  • Please log in to reply
62 replies to this topic

#21 steviewonder

steviewonder

    Member

  • Members
  • PipPip
  • 30 posts

Posted 19 March 2008 - 07:35 PM

What would be the path to have script run exe from
source cd?

$INSTALLLOCATION =

In case it's drive E instead of D, sorry I'm a newb at this :D

#22 w0lfm4n

w0lfm4n

    Lurker

  • Members
  • Pip
  • 1 posts
  • OS:non-selected

Posted 28 March 2008 - 03:06 PM

I found this useful when I cant find any silent switches for my installers :thumb_yello:


$SF_1 = "app.exe"

If WinExists ( $SF_1 ) Then Exit
AutoItWinSetTitle ( $SF_1)

is this added after the script or before

#23 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 8,664 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 28 March 2008 - 05:33 PM

I don't think it matters where you put it, its just a variable. But put it at the begging

#24 steviewonder

steviewonder

    Member

  • Members
  • PipPip
  • 30 posts

Posted 28 March 2008 - 07:21 PM

Thanks I got it figured out

#25 wilson

wilson

    Lurker

  • Members
  • Pip
  • 2 posts
  • OS:non-selected

Posted 09 July 2008 - 03:59 AM

after i finish this script and i get the execute script file,so how can i do for this to make cab nlite addon ?Its that just put the execute script file and the installation file together and make the cab file. At the ini file call the execute script file?can show me the step please

#26 Kelsenellenelvian

Kelsenellenelvian

    Master of my domain!

  • Global Mods
  • 3,049 posts
  • Location:U.S.A.
  • OS:Windows 7 x64

Posted 09 July 2008 - 09:31 AM

[general]

Title	   = 

Version	 = 

Description = 

Language	= 

BuildDate   =

Website	 =



[EditFile]

I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram



[AddProgram]

Program.exe <---- Place the installers name here!


#27 wilson

wilson

    Lurker

  • Members
  • Pip
  • 2 posts
  • OS:non-selected

Posted 12 July 2008 - 06:21 AM

thx ya...but how do i add reg file inside?after finish install and execute reg file?

#28 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 625 posts
  • OS:Windows XP Pro

Posted 13 July 2008 - 12:21 AM

To add reg detail, use the REGWRITE function of the autoit script.

Generally, add your REGWRITE code after the installation. Check the proper syntax from AutoIt3.chm (Autoit help file).

#29 thedexmonster

thedexmonster

    Advanced Member

  • Members
  • PipPipPip
  • 68 posts
  • Location:California
  • OS:Windows 7 x64

Posted 24 July 2008 - 07:00 PM

At the end of DivX setup, a browser window will open whether you're connected to the internet or not. It might be Firefox, it also may be internet explorer. Is there a way to only close the one that opens?

Firefox:
WinWait("Problem loading page - Mozilla Firefox","")
If Not WinActive("Problem loading page - Mozilla Firefox","") Then WinActivate("Problem loading page - Mozilla Firefox","")
WinWaitActive("Problem loading page - Mozilla Firefox","")
Send("{ALTDOWN}{F4}{ALTUP}")

Internet Explorer:
WinWait("Internet Explorer cannot display the webpage - Windows Internet Explorer","Favorites Command Ba")
If Not WinActive("Internet Explorer cannot display the webpage - Windows Internet Explorer","Favorites Command Ba") Then WinActivate("Internet Explorer cannot display the webpage - Windows Internet Explorer","Favorites Command Ba")
WinWaitActive("Internet Explorer cannot display the webpage - Windows Internet Explorer","Favorites Command Ba")
Send("{ALTDOWN}{F4}{ALTUP}")


#30 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 625 posts
  • OS:Windows XP Pro

Posted 26 July 2008 - 08:49 AM

There can only be 1 browser which will be launched. Usually it is IE

However, if you think there are 2 possible browsers to be launch, then just pause the script for browser to self-launch, then close both iexplorer.exe & firefox.exe


[codebox]Sleep (3000); you can adjust the time. Must be longer so that sufficient time is given for the installer to self-launch the browser
ProcessClose ("IEXPLORE.EXE")
ProcessClose ("FIREFOX.exe")[/codebox]

Alternatively, going by your given code:
WinWait("Internet Explorer cannot display the webpage - Windows Internet Explorer","Favorites Command Ba")
ProcessClose ("IEXPLORE.EXE") ; <---New line to close Internet Explorer process. Just like you close process in task manager

Edited by Geej, 26 July 2008 - 08:50 AM.


#31 thedexmonster

thedexmonster

    Advanced Member

  • Members
  • PipPipPip
  • 68 posts
  • Location:California
  • OS:Windows 7 x64

Posted 27 July 2008 - 07:14 AM

There can only be 1 browser which will be launched. Usually it is IE

However, if you think there are 2 possible browsers to be launch, then just pause the script for browser to self-launch, then close both iexplorer.exe & firefox.exe


Sleep (3000); you can adjust the time. Must be longer so that sufficient time is given for the installer to self-launch the browser
ProcessClose ("IEXPLORE.EXE")
ProcessClose ("FIREFOX.exe")

Alternatively, going by your given code:
WinWait("Internet Explorer cannot display the webpage - Windows Internet Explorer","Favorites Command Ba")
ProcessClose ("IEXPLORE.EXE") ; <---New line to close Internet Explorer process. Just like you close process in task manager


Some of my builds have Firefox set as default browser and some use IE. This is why I would like it to work for either. I was wondering if possibly there was a different command to use that didn't rely on me setting a timeout (every computer will take a different time to process). something like an if else statement but I'm not familiar with the AutoIt language :(. If I know, before silent install, which browser is default I can just use a different installer to work with the corresponding browser. This takes up space and is a hassle to maintain.
I appreciate your response. I wasn't aware of that command. It will work for now, It's definitely better than two separate programs.

#32 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 625 posts
  • OS:Windows XP Pro

Posted 28 July 2008 - 06:28 AM

So basically you need a mini-script that can detect default browser (either FF or IE).

Here is my code, which I think can integrated into your Divx setup script

[codebox]#cs
This script test whether default browser is IE or Firefox base on current user setting.
This is also my first time using StringRegExp & StringRight. So if I code it poorly, forgive me.

The registry that store the default browser is HKEY_CURRENT_USER\Software\Classes\http\shell\open\command

Test 1:
To actually test the code, say, you set firefox as default browser. Launch firefox. Also launch IE.
So you have 2 browsers launched. Since you actually set firefox as default browser,
you would expect Firefox browser to procesclose when winwait matches, without procesclose IE.
Run this script to see the effect.

Test 2:
Now set IE as default browser. Launch Firefox as well.
Double check HKEY_CURRENT_USER\Software\Classes\http\shell\open\command has IEXPLORE.EXE as part of string
Run the script. Expected result would be Internet Explorer closed, keeping firefox on the desktop.

You may like to fine tune the script according to your circumstance
#ce


$varF = RegRead("HKEY_CURRENT_USER\Software\Classes\http\shell\open\command", ""); Read what is the string found in this key

$varFF = StringRight ( $varF ,45 ); count the last 45 char from the right. 45 is needed for Firefox string.

$varFFF = StringRegExp ($varFF, "firefox.exe", 1 );compare the 45 char against a search string Firefox.exe

MsgBox(64, "My default Browser is", $varFF); output visually for user to see the string. This line can be disabled for actual run. After testing complete successfully

MsgBox(64, "Show output of string regular expression", $varFFF); output is 0, indicating what is the control code. This line can be disabled for actual run.

;======= Place your DivX installer code here ====

if $varFFF=0 then
WinWait("Internet Explorer cannot display the webpage - Windows Internet Explorer","Favorites Command Ba")
ProcessClose ("IEXPLORE.EXE")
else
WinWait("Problem loading page - Mozilla Firefox","")
ProcessClose ("firefox.exe")
endif
[/codebox]

#33 bjfrog

bjfrog

    WinCert Friend

  • Members
  • PipPipPipPip
  • 238 posts
  • Location:100086
  • OS:Windows 7

Posted 09 August 2008 - 05:49 PM

A biiiiiiiiiiiiig thanks to you ,I finished my maxthon2.1.2 silent installer,it doesn't support silent swich:D

#34 thedexmonster

thedexmonster

    Advanced Member

  • Members
  • PipPipPip
  • 68 posts
  • Location:California
  • OS:Windows 7 x64

Posted 10 August 2008 - 07:39 AM

Thank You Geej!

All I really needed was the syntax to make something work for me!
The registry settings are in Local Machine not Current User. (At least on my running system)
and you have a 45 count in StringRight, On my system it's 44.
But it works!
I simplified it and changed it to:
[codebox]$varF = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\command", ""); Read what is the string found in this key
$varFF = StringRight ( $varF ,44 ); count the last 44 char from the right. 44 is needed for Firefox string.
$varFF = StringLeft ( $varFF ,11 ); count the first 11 characters from the left. Firefox.exe = 11 characters.

if $varFF = "FIREFOX.EXE" Then
WinWait("Problem loading page - Mozilla Firefox","")
ProcessClose ("Firefox.exe")
Else
WinWait("Internet Explorer cannot display the webpage - Windows Internet Explorer","Favorites Command Ba")
ProcessClose ("IExplore.exe")
EndIf
[/codebox]
Maybe I did something wrong and I just don't see it?

#35 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 625 posts
  • OS:Windows XP Pro

Posted 10 August 2008 - 03:07 PM

Glad that modifying the code works for you.

Maybe I did something wrong and I just don't see it?


If firefox is installed, then you will see "HKEY_CURRENT_USER\Software\Classes\HTTP\shell\open\command" key as it is created by firefox during installation. Otherwise it is just as you mention: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\command

Try changing the default browser to Firefox and see if "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\command" value changes. (I believe it still stay as IE)

#36 thedexmonster

thedexmonster

    Advanced Member

  • Members
  • PipPipPip
  • 68 posts
  • Location:California
  • OS:Windows 7 x64

Posted 10 August 2008 - 06:26 PM

If firefox is installed, then you will see "HKEY_CURRENT_USER\Software\Classes\HTTP\shell\open\command" key as it is created by firefox during installation. Otherwise it is just as you mention: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\command

Try changing the default browser to Firefox and see if "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\command" value changes. (I believe it still stay as IE)


It does change to Firefox.

I don't have a "Current_User\Software\Classes\HTTP" entry in my registry.
Firefox is installed. Does it delete it after installation?

#37 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 625 posts
  • OS:Windows XP Pro

Posted 10 August 2008 - 07:19 PM

Forgot to mention that 'HKEY_CURRENT_USER\Software\Classes\HTTP\shell\open\command' was created after I launch Firefox for the first time. (along with many other new registry keys in HKEY_CURRENT_USER\Software\Classes).

HKEY_CURRENT_USER\Software\Classes\HTTP\shell\open\command will not be created if FF is installed by others and I (the current user) have not started FF for the first time. I also need to agree to set as default browser when prompt by Firefox. At least that's what my machine shows.

Nevertheless, since you got it tested and default browser changes occurs in HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\command, I suppose it is okay. Just be aware that some machines may have default browser setting store in HKCU.

If getting too unpredictable, suggest 3rd party tool to preset default bowser as IE. When installation is over, have it reset the browser back to old setting. (have not tried it through) http://www.snapfiles...ultbrowser.html

An article here possible says both of us could be right. :D

BTW, where can I download the DivX installer?

Edited by Geej, 10 August 2008 - 07:33 PM.


#38 tym

tym

    Lurker

  • Members
  • Pip
  • 5 posts
  • OS:non-selected

Posted 29 August 2008 - 12:01 AM

A question. When the file is made and you have the script. You put it in the svcpack folder. Does the program itself need to be in "cab" form or do you want the orginal "setup file".??

The example I was pointed to was lost. Can someone post a "winamp" example? Thats the one I am having the issues with.

#39 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 625 posts
  • OS:Windows XP Pro

Posted 30 August 2008 - 04:04 AM

A question. When the file is made and you have the script. You put it in the svcpack folder. Does the program itself need to be in "cab" form or do you want the orginal "setup file".??

The example I was pointed to was lost. Can someone post a "winamp" example? Thats the one I am having the issues with.


You put your winamp setup file and your autoit compiled script in svcpack folder. Then in your entries.ini,
There is a section [AddProgram]
Put your script name only such as winampscript.exe


See Tray Pilot Lite 1.10 for the example. (download and uncab it to see its structure)

Hope to see you put up this addon soon :D

#40 tym

tym

    Lurker

  • Members
  • Pip
  • 5 posts
  • OS:non-selected

Posted 30 August 2008 - 12:17 PM

Been doing my best geej. I am doing something wrong, I get the script, compile it, it starts the install then half way through it just stops. Then I have to click next and so on. I will get it. Just gotta figure it out. Have another idea or two. Im determined to get winamp to install without interacton on my part.

Well looks like its just not possible to do this with winamp. I have tried everything I could, no luck. If anyone ever makes one PLEASE let me know, Would love to download it.

Edited by tym, 31 August 2008 - 08:09 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users