cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
CChong
Level 11 Flexeran
Level 11 Flexeran

silent install, then restart application

Trying to do silent update. once update is finished patching, start the App.

The problem is that I don't know how to check whether the update is finished. Any ideas?
0 Kudos
(4) Replies
Chris_Woerner
Level 10

I don't know your customer scenario, so please let me know if I am off base here....

If you want the customer to NOT use your application during update, I would recommend.....

check for update during application startup
if found, launch update and close app
have the update restart the application

in this scenario, I would imagine that you would want to show a UI to the users.
0 Kudos
CChong
Level 11 Flexeran
Level 11 Flexeran

That's exactly how I want to do it, but no UI to the users, except a message box telling user to wait for update to finish.

Question: How to get update to restart the application? our updates are packaged as .msp to make the file size small.

oh, by the way, we are using InstallShield Developer 8.02 to package the .msp
0 Kudos
CChong
Level 11 Flexeran
Level 11 Flexeran

Here is my VBScript code. I modified it from the sample VB Code in the Help. It silently updates the application, but it never catch the OnUpdateComplete event (displays message "update is complete". I even tried put a loop in to wait for update to complete.
Any ideas?

' ------ Start Code ----------------------------------------------
ProductID = "{A2FBD1B5-5C47-4C1A-BC6B-A2AECD75E36D}"

Set pAgent = CreateObject( "DWUpdateService.Agent" )

If (pAgent.IsConnected()) Then
If (pAgent.AutoUpdate(ProductID, True)) Then
' Update is downloading and installing. When the update
' is finished, it raises the UpdateComplete event.
' **I tried put loop here to wait. still doesn't work.

Else
MsgBox "No automatic update is available."
End If
End If

Private Sub pAgent_OnDownloadComplete(ByVal nResultCode)
MsgBox "Update is complete."
' Restart application code
End Sub
'------ End Code ---------------------------------------------
0 Kudos
CChong
Level 11 Flexeran
Level 11 Flexeran

Sidney,

I would suggest a slightly different approach that wouldn't require any loops. Let's say you're creating Version 1 and Version 2 of your application, and you want to generate a patch between the two versions. In Version 2, you can insert a Custom Action that launches VBScript, and insert it after InstallFinalize in the Installation | Execute sequence.

Now when you generate a patch between these two versions, the VBScript Custom Action will be included in the patch. And if it's sequenced as indicated above, it will occur after the installation process has completed... therefore no loop is required.

You'll want to condition this VBScript Custom Action appropriately so it only fires during a patch installation. For example, a condition of PATCH might work.

Hope this helps!
0 Kudos