Jump to content

MHz

Member
  • Posts

    1,691
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Australia

Posts posted by MHz

  1. link works great if your running a silent install from a hard drive. problem is getting it to install silently from a DVD (which could be any drive letter) I can use variables to find the exe and the install.xml however, the xml file has exact file locations and so far no variables have worked for me in the xml file. I tried using AutoIT to (right before the CS3 install) rewrite the xml file with the correct drive letters, to the local drive. but it doesn't seem to work...

    for some background, This is for a unattended OS DVD which would install the Master collection silently.

    So you failed on getting it right? Try to give us something to work on (like some xml samples (before/after) and your execution script) and I may come up with a solution. Your problem sounds as recent as was asked here. Help is given if details are enough to understand your problem to start with.

    :)


  2. @echo off

    if exist D:\Isos\Test.iso (
    echo file found
    del D:\Isos\Test.iso
    ) else (
    echo file not found
    )

    If %errorlevel% == 0 (
    echo success
    ) else (
    echo error
    )

    if exist D:\Isos\Test.iso (
    echo file still exists
    )

    pause

    goto :EOF

    Output when the file is in use

    file found

    D:\Isos\Test.iso

    The process cannot access the file because it is being used by another process.

    success

    file still exists

    Press any key to continue . . .

    failed deletion of the file even though it states success.

    And when the file is not in use

    file found

    success

    Press any key to continue . . .

    succeeded deletion of the file.

    Checking if the file exists once is insufficient to validate deletion and %errorlevel% seems to return success upon failure if the file is in use so using a file exists after the deletion does inform of whether deletion actually did fail or not.

    HTH

    :)

  3. So long as the TweakUiPowertoySetup.exe process waits while the spawned msi process does the installation, then you can use the return of the process identification number (PID) from Run() to wait for the TweakUiPowertoySetup.exe process to close.

    Changes made...


    $pid = Run("TweakUiPowertoySetup.exe")
    WinWaitActive("Microsoft Powertoys for Windows XP and Windows Server 2003 Setup", "&Next >")
    Send("!N")
    Send("!a")
    Send("!N")
    Send("{ENTER}")
    ProcessWaitClose($pid)

    ; Check for a \Accessories\Utilities
    ; and create it if necessary
    If Not FileExists(@ProgramsCommonDir & "\Accessories\Utilities") Then
    DirCreate (@ProgramsCommonDir & "\Accessories\Utilities")
    EndIf

    ; Check for shortcut
    ; and copy it to utilities.
    If FileExists(@ProgramsCommonDir & "\Powertoys for Windows XP\Tweak UI.lnk") Then
    Filecopy(@ProgramsCommonDir & "\Powertoys for Windows XP\Tweak UI.lnk", @ProgramsCommonDir & "\Accessories\Utilities")
    EndIf

    ; Check for shortcut folder
    ; and delete it
    If FileExists(@ProgramsCommonDir & "\Powertoys for Windows XP") Then
    DirRemove(@ProgramsCommonDir & "\Powertoys for Windows XP", 1)
    EndIf

    See if the above changes helps you.

    Some advice: Waiting for each identified window during installation may make your script more reliable.

    :)

  4. So i can use this in the [Run] section to kill a process

    It looks OK to me. TaskKill is a standalone file so you should be able to run it without using CMD to do it.

    Example script


    AppName=Test
    AppVersion=1.0
    VersionInfoVersion=1.0
    AppVerName=Test 1.0
    OutputBaseFilename=Test 1.0
    UninstallDisplayName=Test
    VersionInfoDescription=Test Setup
    DefaultDirName={pf}\Test
    DefaultGroupName=Test
    SolidCompression=true
    AllowRootDirectory=true
    DirExistsWarning=no
    AllowNoIcons=true
    AlwaysShowDirOnReadyPage=true
    AlwaysShowGroupOnReadyPage=true
    WizardImageFile=compiler:wizmodernimage.bmp
    WizardSmallImageFile=compiler:wizmodernsmallimage.bmp

    [Files]
    Source: C:\WINDOWS\NOTEPAD.EXE; DestDir: {app}

    [Run]
    Filename: {app}\NOTEPAD.EXE; Flags: nowait
    Filename: taskkill; Parameters: /f /im notepad.exe; WorkingDir: {sys}; Flags: runhidden postinstall; Description: Close Notepad

    :)

  5. This test script demonstrates using the CMD interpreter to del a file in the [Run] section. With closing a process depends on having something like TaskKill.exe available for use on your Windows OS as not all have it.


    [Setup]
    AppName=Test
    AppVersion=1.0
    VersionInfoVersion=1.0
    AppVerName=Test 1.0
    OutputBaseFilename=Test 1.0
    UninstallDisplayName=Test
    VersionInfoDescription=Test Setup
    DefaultDirName={pf}\Test
    DefaultGroupName=Test
    SolidCompression=true
    AllowRootDirectory=true
    DirExistsWarning=no
    AllowNoIcons=true
    AlwaysShowDirOnReadyPage=true
    AlwaysShowGroupOnReadyPage=true
    WizardImageFile=compiler:wizmodernimage.bmp
    WizardSmallImageFile=compiler:wizmodernsmallimage.bmp

    [Files]
    Source: C:\WINDOWS\NOTEPAD.EXE; DestDir: {app}

    [Run]
    Filename: cmd; Parameters: /c del notepad.exe; WorkingDir: {app}; StatusMsg: Deleting files...; Flags: runhidden postinstall; Description: "Run CMD to delete notepad.exe in the ""{app}"" directory"

    :)

  6. I would be guessing that NAV is using the Wise installer. I am not aware of silent uninstallation for it. You could look at handling the complete process with VBS using sendkeys, VBS with AutoItX.dll or AutoIt3 alone (or perhaps other languages with AutoIt3X.dll). You should be able to read the uninstall string from registry, run the string and automate any dialogs afterwards. Running a Norton Removal Tool from the script should to be easy as well as removing other registry entries.

    An uninstall string should work from a cmd prompt unless you forgot to use quotes as the string should have already. A working directory is not passed from registry so paths in the string are normally absolute paths. I have seen some uninstall strings using a guessed 8.3 path used and that can cause errors if incorrect.

    :)

  7. Hi,

    Nice strategy but your comment used of that AutoIt may not support data structures seems odd. To explain, when you show within your strategy of using the AutoIt array syntax, that is AFAIK, a data structure.

    Your strategy looks rigid and concise with requirements and what I do notice is timeouts and handling complete install, uninstall etc tasks. If the install is to be automated, then I would consider using a Select Case within a loop to handle the various windows, whether it be the install type or uninstall type. If the loop is not exited within a certain period of time then an action can be done, whether to exit the script or call a function to do something else. It appears functions do not appear within your strategy, yet they can make a major task of creating a ton of scripts easier as common code can be wrapped in functions and even shared amongst the scripts by including them.

    Using templates would be a logical choice to be a step along with your strategy and make your scripts uniform. You are quite welcome to use the templates within SendToA3X to make your installation scripts. SendToA3X will identify the commonly used installers and create a script based on a template for you to supply details to complete. The automation templates give a choice of using WinWait or WinExists in a loop. You may consider the WinExists in a loop to allow multiple tasks or use a WinWait sequence for the concept of multiple scripts to handle install, uninstall etc.

    Some scripts here may serve as an example of using templates. Most are not automated so may not be within your strategy but shows a uniform approach.

    Some advice above for you to evaluate. :)

  8. I'm trying to use this as a sfx script in winrar. With autoit script you can use :

    @DesktopCommonDir and @ProgramsDir which gives the path of the desktop and startmenu.

    @DesktopCommonDir, @DesktopDir, @ProgramsCommonDir and @ProgramsDir to be more precise. :)

    Is there in the sfx script such a command?

    Perhaps

    The command %AllUsersProfile%\Start Menu\Programs in sfx script won't work on all windows versions. The dutch version of xp has a different path name. The autoit script does work on all windows versions.

    Ah, language issue with folder/file names. Autoit does some internal calculations to get those macros above.

    It would depend on what you are trying to do with WinRAR as shortcut creation exists within WinRAR.

    Shortcut=<DestType>,<SrcName>,<DestFolder>,<Description>,<ShortcutName>

    Create a shortcut to unpacked file.

    DestType is one character wide field, which can have the following values:

    D Create a shortcut on Desktop

    S Create a shortcut in Start Menu

    [color=#FF0000][b]P Create a shortcut in Start Menu/Programs [/b][/color]

    T Create a shortcut in Startup folder

    SrcName is a name of archived file.

    DestFolder is a folder to create a shortcut in. If it does not exist, it will be created by SFX archive.

    Description is a text string describing a shortcut.

    ShortcutName is a name of .lnk (shortcut) file created by SFX.

    All parameters are separated by commas. If you need to put a comma character inside of parameter, enclose the whole parameter to quotes. Repeat quotes twice if you need to insert a quote mark into string. Only DestType and SrcName are required, other parameters are optional.

    Example

    Create a shortcut on Desktop in the folder WinRAR to archived file winrar.exe with the description "WinRAR executable file" and name "WinRAR archiver":

    Shortcut=D, winrar.exe, WinRAR, "WinRAR executable file", "WinRAR archiver"

    If WinRAR does not do enough for you, then you could look at Inno Setup as it has adequate constants for like the "start menu/programs" folder location.

    :)

  9. Would it be possible to make a AutoIt script, that could install any application silently?

    Silently No as installers are too diverse in their methods. Automated Yes, based on common installers only.

    There is a lot of application installers that uses same dialogs always. Maybe those can be identified with AutoIt script without hard coding for each application. I could start to develop that kind of script, but I need some assistance and professional opinions before I start planning the script.

    Or would it be completely waste of my time?

    It is unlikely that you can cover for every unexpected scenario but you can do most. Sure AutoIt can do things based on logic so creating your concept is not impossible at all. i have done something similar in the past for something to tinker with and it worked ok for it's minor test but unless it does 100% of installations, then I would rather concentrate on a concept that does offer that 100% success rate.

    I, myself use script templates to make installation scripts quick without repeating similar code over and over. SendToA3X creates the scripts based off templates. Some script examples can be viewed here.

    :)

  10. What is the difference in folder location for the desktop and startmenu between XP an Vista.

    Is it possible to copy the shortcuts to the startmenu for xp as well as for vista with a command like:

    "%AllUsersProfile%\Start Menu\Programs"

    Or will this only work for vista ?

    I want to make a silent installation that works on both xp and vista.

    The environmental variables that exist in XP, also exist in Vista. Paths in XP scripts should work fine in Vista unless you added into your script some hard coded paths that would have been better to have used environmental variables instead.

    :)

  11. Avast Antivirus say : troyan - Win32:AutoIt-V [Trj].

    Please help me. :blushing:

    Indeed contact Avast. I use Avast as well so I sent an email to virus at avast dot com with some details. Hopefully a resolution will come soon.

    ;)

  12. I tried downloading CMenu from the above link but every time I try to unzip it, I'm told it's an invalid zip file.

    Anyone else getting this??

    I confirm and deleted the zip file and replaced with a valid zip file (tested).

    CMenu 2.6

    BigRandalo, Thanks for the link posted. :)

  13. Hi!

    I have a question:

    I try to make a script for DivX 6.6.1, but after "Choose Components" window, the installer stop responding to the script, installing Firefox and goes to finish even the script lines is finished.

    What command can I use to "taming" this installer?

    "Sleep" command does not work.

    Just a thought why don't you go to AutoIt Forum with questions related to AutoIt? There are a lot of ppl there and can help you to achieve what you want? MSFN is good but for AutoIt purpose i would suggest using official forum :)

    So what are you saying? That an offering of help from an "AutoIt Forum MVP member" is not good enough here? :blink:

  14. Hi!

    I have a question:

    I try to make a script for DivX 6.6.1, but after "Choose Components" window, the installer stop responding to the script, installing Firefox and goes to finish even the script lines is finished.

    What command can I use to "taming" this installer?

    "Sleep" command does not work.

    If the script finishes before the installation is finished then use ProcessWaitClose() with the Process ID returned from Run(). If you need further help then attaching your script may help to see your problem.

    :)

  15. If I left click once on the systray icon, then a moment later a tooltip sized window appears and I can click on one of the drives listed to safely remove it. If I click more then once with a left click then a window appears where you can safely remove any drive listed or get drive properties etc. If I right click on the systray icon, then appears a tooltip window to "Show Remove Hardware" which is the alternate 2 click method compared to the left double click.

    Sometimes you may not know which drive letter resembles your drive so right clicking on the drive within My Computer to safely remove the drive is a good method as you also have the drive title name to recognize the drive.

    :)

  16. JK Defrag, so small, so powerfull

    ScanDefrag makes good use of JkDefrag if added into ScanDefrag's install directory and it will be detected. PageDefrg can also be added into ScanDefrag's directory and it will be detected. Then you can also add JkDefrag_Gui into the install directory for using it's Gui interface.

    It is the combination of defrag tools I prefer to use. :)

×
×
  • Create New...