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 ...
-
3rd July 2007, 02:49 PM #1 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?
-
-
IDG Tech News
-
3rd July 2007, 02:59 PM #2 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.
-
-
3rd July 2007, 03:03 PM #3 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
-
-
3rd July 2007, 03:14 PM #4 Re: AutoIT help
The checking for the folders existence sounds ideal but what do i need to add to the script to do this?
-
-
3rd July 2007, 03:22 PM #5 Re: AutoIT help

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.
-
-
3rd July 2007, 04:01 PM #6 Re: AutoIT help
You absolute star. This works perfectly and helped me out of a rather large hole. I owe you a beer ;¬)
-
-
10th July 2007, 01:55 PM #7 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?
-
-
10th July 2007, 02:22 PM #8 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.
-
-
10th July 2007, 03:15 PM #9 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
-
-
10th July 2007, 03:22 PM #10 Re: AutoIT help
Can't all that just be done in a batch file? You can make the RM application agent run batch scripts.
-
-
10th July 2007, 03:38 PM #11 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?
-
-
10th July 2007, 04:19 PM #12 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!
-
-
10th July 2007, 08:59 PM #13 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.
-
-
11th July 2007, 08:39 AM #14 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.
-
-
11th July 2007, 09:26 AM #15 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:
Similar Threads
-
By K.C.Leblanc in forum Scripts
Replies: 7
Last Post: 28th November 2007, 04:27 PM
-
By chrbb in forum Windows
Replies: 6
Last Post: 14th November 2007, 09:15 AM
-
Replies: 3
Last Post: 3rd July 2007, 01:29 PM
-
By NetworkGeezer in forum Scripts
Replies: 2
Last Post: 9th May 2007, 08:00 PM
-
By SpuffMonkey in forum How do you do....it?
Replies: 3
Last Post: 21st March 2007, 02: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
-
Forum Rules