K1000 Online KScript confusion - silent uninstall/install for Skype
I have been working with the K1000 scripting mechanisms as a way of updating Skype the last couple days, and although I have finally figured it out, I am left very confused, and was hoping to straighten out a few things.
My method consists of using wscript with a VBS wrapper that silently launches various batch files. The first thing that happens is a batch is run to stop skype via skype.exe /shutdown. Then I run another batch script to calls a powershell command to uninstall skype. Finally the install skype batch is run, which calls the skype msi silently.
This is what the successful KScript looks like:
My trouble was that it seems that all of those batch scripts end up running at the same time!
My solution was to start the install batch script with a 60 second delay (pinging a non-existant address). Otherwise the install would fail because the uninstall hadn't finished.
I found that even if I split the Install part into a whole separate task, that both tasks started concurrently.
Is this how the KScripting is supposed to work? My impression was that each step or task would wait for the previous step to finish.
Answers (3)
You'll notice "On Success" you are having it launch three scripts all at once; in other words "Kbox, on success I want you to do tasks 1 through 5". If invis.vbs hides everything that is executed from that script you could have one batch file doing all three of those tasks with a "start /wait" command on each line, otherwise your sleep method would be the best course of action.
Doesn't the Skype installer uninstall old versions? It seems that just using the /qn switch on the MSI would do what you wanted.
Comments:
-
the Skype documentation indicated that it should uninstall the old version, but that is not what I found. It through me a "must uninstall old version" error and then exited.
I found that even if I split the "install" part up into a whole new task (Task 1: Uninstall, Task 2: Install) it wouldn't wait for the first task to finish. - muebel 12 years ago
Since your just calling bat files and vbs you might want to try shell scripts. I think this will give you the result your after.
Comments:
-
the shell scripts result in a blank cmd window sitting there, begging for the user to close it - muebel 12 years ago