I have a solution, which looks somewhat creepy to me, but it works:
I download the installer to a folder in SpecialFolder.ApplicationData
I launch a helper console app and terminate the main application.
The helper app uses an interactive shell to launch the installer (to provide sudo password):
[code] App.imInstallShell = New Shell
App.imInstallShell.Mode = 2 // Interactive
Dim cmd As String = "sudo installer -pkg " _
+ chr(34) + App.InstallerPath + chr(34) + " -target /"
If Not App.imInstallShell.IsRunning Then
App.imInstallShell.Execute "sh"
End If
Dim pw As String = App.InstallerPW
// Now start the installer
App.imInstallShell.Write(cmd)
App.imInstallShell.Write(Chr(13))
// Send password
App.imInstallShell.Write(pw)
App.imInstallShell.Write(Chr(13))[/code]
I have a Loop in the console’s Run event, with a App.DoEvents, where I check for install finished condition and then I launch the updated app.
On the very first run (and in user settings) I ask for the password and if the user wishes silent update, then I store the password in the keychain.
I noticed, that our users tend to not update, because they don’t like all that clicking and password entering of the standard installer.
you might be better off putting the installer in the temporary items dir just so it gets removed when / if the user logs out & logs back in or as part of normal maintenance
otherwise you’re going to need to do that for them
[quote=58659:@Norman Palardy]you might be better off putting the installer in the temporary items dir just so it gets removed when / if the user logs out & logs back in or as part of normal maintenance
otherwise you’re going to need to do that for them[/quote]
Yes, I do cleanup from my own code now. But I think your suggestion is a better idea.