Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

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

 

Run("C:\WINDOWS\$NtUninstallwmp11$\spuninst\spuninst.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?

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

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

Posted
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\spuninst.exe /quiet /norestart")

EndIf

 

Alternatively, you could just specify a timeout on the WinWaitActivate command.

Posted

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?

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

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?

Posted
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!
Posted
"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.
Posted
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.
Posted

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

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



×
×
  • Create New...