+ Post New Thread
Results 1 to 15 of 15
Windows Thread, AutoIT help in Technical; I have a very simple script which was compiled in AutoIT: Run("C:\WINDOWS\$NtUninstallwmp11$\spuninst\spunin st.exe /quiet /norestart") As I'm on an RM ...
  1. #1
    randle's Avatar
    Join Date
    Dec 2006
    Location
    Chelmsford, Essex
    Posts
    603
    Thank Post
    67
    Thanked 17 Times in 16 Posts
    Rep Power
    19

    AutoIT help

    I have a very simple script which was compiled in AutoIT:

    Run("C:\WINDOWS\$NtUninstallwmp11$\spuninst\spunin st.exe /quiet /norestart")
    As I'm on an RM CC3 network installation/uninstallation needs to be done via msi's of which i have created a blank one just for this purpose but this is just ignored and a command to run the script is used instead.

    My problem is that although the above command removes wmp11 when allocated out to stations, it tries to run the command again when unallocated which then brings up an error window saying that it can't find the path. Obviously this is going to be the case as it's been removed by the install of this but needs user intervention to get rid of this window.

    If i add the commands:
    WinWaitActive("AutoIT Error")
    Send("{ENTER}")
    It just messes up the install as the script can't finish because this window doesn't appear at this stage so really i need to add an IF command so that this only happens if this window appears. Can anyone tell me whether this can be done and if so how?

  2. #2

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,069 Times in 625 Posts
    Rep Power
    740

    Re: AutoIT help

    A bit messy but I would put a flag file [ copy over ] in the location of the folder where the spuninst.exe is. I would then have an 'If' statement before of after stating if the file is there to quit the script or run it.

  3. #3

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,602
    Thank Post
    725
    Thanked 1,685 Times in 1,500 Posts
    Rep Power
    432

    Re: AutoIT help

    Either that or is there a way in autoit to check for the existence of a file/folder if it isn't there it's allready be unistalled so don't continue.

    Ben

  4. #4
    randle's Avatar
    Join Date
    Dec 2006
    Location
    Chelmsford, Essex
    Posts
    603
    Thank Post
    67
    Thanked 17 Times in 16 Posts
    Rep Power
    19

    Re: AutoIT help

    The checking for the folders existence sounds ideal but what do i need to add to the script to do this?

  5. #5
    michaelf's Avatar
    Join Date
    Jun 2007
    Location
    Kettering, Northants
    Posts
    81
    Thank Post
    7
    Thanked 13 Times in 10 Posts
    Rep Power
    17

    Re: AutoIT help

    Quote Originally Posted by randle
    The checking for the folders existence sounds ideal but what do i need to add to the script to do this?
    This should do the trick:

    IF FileExists ("PathOfSomeWP11File") Then
    Run("C:\WINDOWS\$NtUninstallwmp11$\spuninst\spunin st.exe /quiet /norestart")
    EndIf
    Alternatively, you could just specify a timeout on the WinWaitActivate command.

  6. #6
    randle's Avatar
    Join Date
    Dec 2006
    Location
    Chelmsford, Essex
    Posts
    603
    Thank Post
    67
    Thanked 17 Times in 16 Posts
    Rep Power
    19

    Re: AutoIT help

    You absolute star. This works perfectly and helped me out of a rather large hole. I owe you a beer ;¬)

  7. #7
    randle's Avatar
    Join Date
    Dec 2006
    Location
    Chelmsford, Essex
    Posts
    603
    Thank Post
    67
    Thanked 17 Times in 16 Posts
    Rep Power
    19

    Re: AutoIT help

    I have been using the above script for some time now which works fine although i need to add another command to it now. This time to remove the Windows media format run-times. I've added the exact same command but with a different path obviously to the bottom of the previous one but when run it only performs one of the commands!! To get this to perform the other it needs to be run again.

    Is there an AND command that i need to add or a timeout?

  8. #8
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: AutoIT help

    The correct way to do this would be to author the MSI so that the script runs in installation only. To do this you need to add the 'NOT Installed' condition on the custom action.

  9. #9
    randle's Avatar
    Join Date
    Dec 2006
    Location
    Chelmsford, Essex
    Posts
    603
    Thank Post
    67
    Thanked 17 Times in 16 Posts
    Rep Power
    19

    Re: AutoIT help

    I know that an msi is the correct way but i don't have a problem with it running on uninstall anymore. I just need it to run both commands now

  10. #10
    nicholab's Avatar
    Join Date
    Nov 2006
    Location
    Birmingham
    Posts
    1,526
    Thank Post
    4
    Thanked 100 Times in 96 Posts
    Blog Entries
    1
    Rep Power
    53

    Re: AutoIT help

    Can't all that just be done in a batch file? You can make the RM application agent run batch scripts.

  11. #11
    randle's Avatar
    Join Date
    Dec 2006
    Location
    Chelmsford, Essex
    Posts
    603
    Thank Post
    67
    Thanked 17 Times in 16 Posts
    Rep Power
    19

    Re: AutoIT help

    I don't know what syntax i would use in place of what i already have as I thought some of it is unique to AutoIt or am i wrong?

    Are you saying that you can point to a bat file using the "EXEFile=" entry? I thought this had to be an exe file or do you mean another way?

  12. #12
    randle's Avatar
    Join Date
    Dec 2006
    Location
    Chelmsford, Essex
    Posts
    603
    Thank Post
    67
    Thanked 17 Times in 16 Posts
    Rep Power
    19

    Re: AutoIT help

    I think i may be ok. I've just added the "sleep(delay)" control to pause the script and let the first command run and think this may have worked!

  13. #13
    nicholab's Avatar
    Join Date
    Nov 2006
    Location
    Birmingham
    Posts
    1,526
    Thank Post
    4
    Thanked 100 Times in 96 Posts
    Blog Entries
    1
    Rep Power
    53

    Re: AutoIT help

    "point to a bat file using the "EXEFile=" entry?" Yes that what I have done I then use that addcommand on the next line and pointed to the batch file again. I have created three packages this way one for java 6 and two for the smartboard. If the installer is in MSI format you can use the addcommand to directly add msi command line parameter. Another trick is to have two ini file a package which looks to the rm system like two packages this mean that you can to different installs form the same core files. When I am in work I will post the ini file for every one.

  14. #14
    randle's Avatar
    Join Date
    Dec 2006
    Location
    Chelmsford, Essex
    Posts
    603
    Thank Post
    67
    Thanked 17 Times in 16 Posts
    Rep Power
    19

    Re: AutoIT help

    Ah. I didn't think about Two different ini files. I like that idea and would have worked a treat. I could have even made Two seperate scripts with that. The sleep control seems to work a treat but thanks for the help.

  15. #15
    nicholab's Avatar
    Join Date
    Nov 2006
    Location
    Birmingham
    Posts
    1,526
    Thank Post
    4
    Thanked 100 Times in 96 Posts
    Blog Entries
    1
    Rep Power
    53

    Re: AutoIT help

    Note these are package ini file for an RM CC3 system.

    Smartboard ini file1:

    [Package]
    OS=5.WS
    Description=Smartboard Software version 9_5_91
    EXEFile=notebook.bat
    AddCommand=notebook.bat
    UninstallEXEFile=note_un.bat
    UninstallCommand=note_un.bat

    Smartboard ini file2:

    [Package]
    OS=5.WS
    Description=Smartboard Software version 9_5_91
    EXEFile=smart.bat
    AddCommand=smart.bat
    UninstallEXEFile=smart_un.bat
    UninstallCommand=note_un.bat

    Note both of the above use that same uninstall batch file.

    If you create ini file you have to update the RM package list. If you get duplication you need to go into active directory management and delete the package with a similar name. But I am guessing you may have done this all ready. Hope this helps people it took me months to grasp this stuff. :x

SHARE:
+ Post New Thread

Similar Threads

  1. AutoIT help.
    By K.C.Leblanc in forum Scripts
    Replies: 7
    Last Post: 28th November 2007, 03:27 PM
  2. software via autoit in AD
    By chrbb in forum Windows
    Replies: 6
    Last Post: 14th November 2007, 08:15 AM
  3. AutoIT
    By Gatt in forum Scripts
    Replies: 3
    Last Post: 3rd July 2007, 01:29 PM
  4. AutoIT process communication
    By NetworkGeezer in forum Scripts
    Replies: 2
    Last Post: 9th May 2007, 08:00 PM
  5. Install software using AutoIT??
    By SpuffMonkey in forum How do you do....it?
    Replies: 3
    Last Post: 21st March 2007, 01:50 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •