Jump to content

Autoit3 Setup - Parameter to run it unattended?


Recommended Posts

Hello,

this question was asked maybe about 3 weeks ago - I apologize, that I cannot find it.

IIRC it was jus a command line switch like

"autoit-v3-setup.exe -u" but I cannot guess the correct switch (tried /a -a /u -u /s -s)

Beside this, is there a possiblility to tell the setup through command line options the other things you can make choices during the setup?

- Installation path

- Deinstall first, if older version found

- edit scripts (instead of run)

Is the same possible for SciTe as well?

Thanks, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Hi.

Both AutoIt v3 and Scite4AutoIt3 use the NSIS installer. Use the uppercase switch /S to install unattended. :(

Ah! ;) It has to be a captial letter "S" :D

Thanks!! (inbetween I wrote a autoit script trying all [-|/][a..z] :))

And is there any way to control the other things like program folder, deinstall old version first, edit scripts as default action?

Regards, Rudi.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Hi.

Ah! ;) It has to be a captial letter "S" :D

Thanks!! (inbetween I wrote a autoit script trying all [-|/][a..z] :))

And is there any way to control the other things like program folder, deinstall old version first, edit scripts as default action?

Regards, Rudi.

For the uninstall you could get the uninstall command string from the registry and execute that. The following is from the NSIS help file

3.2 Installer Usage

Generated installers and uninstallers accept a few options on the command line. These options give the user a bit more control over the installation process.

3.2.1 Common Options

/NCRC disables the CRC check, unless CRCCheck force was used in the script.

/S runs the installer or uninstaller silently. See section 4.12 for more information.

/D sets the default installation directory ($INSTDIR), overriding InstallDir and InstallDirRegKey. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces.

3.2.2 Uninstaller Specific Options

_?= sets $INSTDIR. It also stops the uninstaller from copying itself to the temporary directory and running from there. It can be used along with ExecWait to wait for the uninstaller to finish. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces.

3.2.3 Examples

installer.exe /NCRC

installer.exe /S

installer.exe /D=C:\Program Files\NSIS

installer.exe /NCRC /S /D=C:\Program Files\NSIS

uninstaller.exe /S _?=C:\Program Files\NSIS

# uninstall old version

ExecWait '"$INSTDIR\uninstaller.exe" /S _?=$INSTDIR'

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Hi.

NSIS has just few default switches like GEOSoft states.

Scite4AutoIt may support additional switches BETA, PROD or LATEST for UpdateDefs.exe to load definitions during install.

Thanks to both of you!

Is there a way to specify the default action for *.AU3" files to be "edit" in stead of "run" after the installation, too?

Regards, Rudi.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Hi.

Thanks to both of you!

Is there a way to specify the default action for *.AU3" files to be "edit" in stead of "run" after the installation, too?

Regards, Rudi.

I'm going to assume that you are writing an AutoIt script to do these installs for you so the easiest thing to do is add a RegWrite("HKCR\AutoIt3Script\Shell", "", "Edit")

at the end of your script.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Hello.

I'm going to assume that you are writing an AutoIt script to do these installs for you so the easiest thing to do is add a RegWrite("HKCR\AutoIt3Script\Shell", "", "Edit")

at the end of your script.

You :) are right.

This is currently set to "Edit Script" on my laptop, I'll try "Edit" as well.

Thanks, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Hello.

The script is written, but not working for the uninstall part in case older versions are found. I tried this switch for the uninstaller, but that's propably the wrong way? :D

ExecWait '"$INSTDIR\uninstaller.exe" /S _?=$INSTDIR'

Dim $UninstStr
Dim $UnInstPostfix =" ExecWait '""$INSTDIR\uninstaller.exe"" /S _?=$INSTDIR'"

;DebugView 1x starten, wenn installiert.
if FileExists(envGet("systemroot") & "\dbgview.exe") then 
    if not ProcessExists("dbgview.exe") then
        Run(envGet("systemroot") & "\dbgview.exe")
        sleep(500)
    EndIf
EndIf

; Lesen, ob alte Versionen installiert sind.
$OldAutoit = RegRead("hklm\software\microsoft\windows\currentversion\uninstall\autoitv3", "UninstallString")
if $OldAutoit Then  $UninstStr &= $OldAutoit 
$OldAutotBeta = RegRead("hklm\software\microsoft\windows\currentversion\uninstall\autoitv3beta", "UninstallString")
if $OldAutotBeta Then $UninstStr &= @LF & $OldAutotBeta
$OldScite = RegRead("hklm\software\microsoft\windows\currentversion\uninstall\SciTE4Autoit3", "UninstallString")
if $OldScite Then $UninstStr &= @LF & $OldScite

; Lesen, ob neue Versionen vorhanden sind.
$OK = True
$ini = "\\nw03goe\nw03vol1\install\tools\Batch-Scripting\Autoit-install.ini"
If Not FileExists($ini) Then NixIni() ; -> dort exit.

$autoit = IniRead($ini, "Pfade", "AI3", False)
if not $autoit then $OK = False
if not FileExists($autoit) Then $OK = False
dbg("$autoit = " & $autoit)

$scite = IniRead($ini, "Pfade", "SCITE", False)
If Not $scite Then $OK = False
if not FileExists($scite) then $ok = False
dbg("$scite = " & $scite)

if not $OK Then Fehler()
; Neue Versionen existieren, ggf. alte erst deinstallieren. 
if $UninstStr Then 
    dbg($UninstStr)
    MsgBox(64, "Info: Alte Versionen werden zuerst deinstalliert.", $UninstStr,5)
EndIf

$MyGui=GUICreate("Autoit3 Installation", 300, 55)
$label = GUICtrlCreateLabel("Installation / Update von Autoit und SciTe Editor", 20, 20, 260, 30)
GUISetState(@SW_SHOW)

; ggf. alte Versionen erst deinstallieren.
; Autoit Beta
if $OldAutotBeta Then 
    GUICtrlSetData($label, "Uninstall alte Autoit *Beta* Version läuft, bitte warten ...")
    dbg("Uninstall AutoIt Beta - Start")
    RunWait($OldAutotBeta & $UnInstPostfix)
    dbg("Uninstall AutoIt Beta - Fertig")
EndIf

;Autoit
If $OldAutoit Then
    GUICtrlSetData($label, "Uninstall altes Autoit läuft, bitte warten ...")
    dbg("Uninstall AutoIt      - Start")
    RunWait($OldAutoit & $UnInstPostfix)
    dbg("Uninstall AutoIt      - Fertig")
EndIf

;SciTe
If $OldScite Then
    GUICtrlSetData($label, "Uninstall altes SciTe läuft, bitte warten ...")
    dbg("Uninstall SciTe       - Start")
    RunWait($OldScite & $UnInstPostfix)
    dbg("Uninstall SciTe       - Fertig")
EndIf

; Neue Versionen installieren
; AUTOIT
GUICtrlSetData($label, "Installation von Autoit läuft, bitte warten ...")
dbg("  Install AutoIt      - Start")
RunWait($scite & " /S")
GUICtrlSetData($label, "Installation von Autoit ist abgeschlossen.")
dbg("  Install AutoIt      - Fertig")

; SCITE
GUICtrlSetData($label, "Installation von SciTE Editor läuft, bitte warten ...")
dbg("  Install SciTe       - Start")
RunWait($scite & " /S")
GUICtrlSetData($label, "Installation von SciTe Editor ist abgeschlossen.")
dbg("  Install SciTe       - Fertig")

GUIDelete($MyGui)

RegWrite("HKCR\AutoIt3Script\Shell", "", "REG_SZ","Edit Script") ; damit Edit - Default
MsgBox(64, "Fertig", "Autoit3 und SciTe Editor sind installiert." & @LF &  "Doppelklick auf AU3 Files editiert.", 10)


Func Fehler ()
    Msgbox (48,"Fehler","Es stimmt eine Angabe in der INI für die Installationsdateien nicht: " & @lf & @LF & _
            "Autoit3: " & $autoit & @LF & _
            "SciTe  : " & $scite & @LF & @LF & _
            "Angaben kommen aus der Datei " & $ini & @lf &@lf &@lf & _
                        "Diese INI Datei muss so z.B. aussehen:" & @LF & @LF & _
            "[Pfade]" & @LF & _
            "AI3=\\server\volume\pfad\pfad\Autoit-V3-Setup.exe" & @LF & _
            "SCITE=\\server\volume\pfad\pfad\Autoit-V3-Setup.exe")
EndFunc


Func NixIni()
    MsgBox(0, "AutoIt und SciTE Installation: Fehler", "Kann die INI Datei nicht lesen:" & @LF & $ini & @LF & _
              "Entweder fehlt die Datei, oder sie sind nicht am Netz angemeldet...")
    Exit
EndFunc   ;==>NixIni

Func dbg($msg)
    DllCall("kernel32.dll", "none", "OutputDebugString", "str", $msg)
EndFunc

Propably simply a syntax mistake? :)

who can ;) me so that I'll see it, too? :(

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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...