Launch WinGup Updater from App

Hello,

I’m trying to launch WinGup (http://wingup.org/) from within my Xojo Windows application, which is located in an “Updater” folder within the program folder. The folder contains GUP.exe (the updater application), libcurl.dll, and gup.xml (a file that contains a number of settings for GUP.exe).

From Windows, within the folder, when I double-click on GUP.exe, all works well (reporting whether or not an update is available. Calling GUP.exe from within my application (code below), WinGup reports an invalid XML configuration file. I think this is because GUP.exe can’t see the gup.xml file, which is located right next to it in the Updater folder.

[code] // Check for update

// Declare variables
Dim f As FolderItem

// Check for update
If Right(App.ExecutableFile.Parent.NativePath, 1) = “” Then
f = GetFolderItem(App.ExecutableFile.Parent.NativePath + _
App.UPDATER_FOLDER)
Else
f = GetFolderItem(App.ExecutableFile.Parent.NativePath + “” + _
App.UPDATER_FOLDER)
End If

f = f.Child(App.UPDATER_EXECUTABLE)
f.Launch

// Error handling
Exception err[/code]

I’ve tried locating the WinGup files in the same folder as my application’s executable file, and the Shell command instead of FolderItem, to no avail. It seems additional logic is needed to pair gup.xml with GUP.exe when launching …

Thanks,
Christopher

You probably need to set the current working directory so wingup finds things next to the exe

a shell should be able to do something like “cd " + f.Child(App.UPDATER_EXECUTABLE).NativePath " ; wingup”

so that it first cd’s to the dir where your wingup set up is then invokes wingup

Norman, thanks, and that was it! Although, I had to use the ampersand (&) over the semicolon (;), for DOS. Here is the working code:

[code] // Check for update

// Declare variables
Dim s As Shell

// Check for update
s = New Shell
s.Mode = 1 // Asynchronous
If Right(App.ExecutableFile.Parent.NativePath, 1) = “” Then
s.Execute("cd " + App.ExecutableFile.Parent.NativePath + _
App.UPDATER_FOLDER + " & " + _
App.UPDATER_EXECUTABLE, _
App.strShortVersion)
Else
s.Execute("cd " + App.ExecutableFile.Parent.NativePath + “” + _
App.UPDATER_FOLDER + " & " + _
App.UPDATER_EXECUTABLE, _
App.strShortVersion)
End If

// Error handling
Exception err[/code]

Ah right & is DOS ; is Unix :stuck_out_tongue: