|
#1
|
||||
|
||||
|
Patching a application problem
I am trying to run my tu.exe(True Update) file everytime my application opens. So under my project actions On Startup I am using:
result = File.Run("AutoPlay\\Update\\tu.exe", "", "", SW_SHOWNORMAL, true); if (result == 5) then Application.Exit(0); end It works if I just run the patch from my computer but when I upload the patch to a server and update using TrueUpdate then it asks to reboot after patching. If you choose not to reboot patch works fine but it opens the older version then the newer version. If you choose to reboot patch doesn't work. Please Help. |
|
#2
|
||||
|
||||
|
Following your description, this looks like you have an error in your patch file or update procedure. Without further information, you can't expect much help...
Ulrich |
|
#3
|
||||
|
||||
|
Quote:
Most likely the problem is answered by the "wait for return" being true. If the AMS exe is running, and is to be updated by tu.exe; then a reboot will be required... I would suggest a two launch approach; update your TU project to allow for a parameter "eg: /CheckOnly" that returns 0 or 1 (1=there is an update available) Then you can run the TU.exe w/o waiting for the return... |
|
#4
|
||||
|
||||
|
how do i do that?
If I dont have the AMS wait for a return (set to true) the my AMS will open and depending on the internet speed the tu.exe update will come up behind my AMS telling me there is an update and sometimes my customers dont see it.
The reason I am having it wait for a return is because my AMS wont open until my tu.exe runs and finds a patch. It works until it needs a patch, if it needs a patch it works and patches but then it says it needs a reboot and opens my old version & the new version and says error while patching. So I guess my main questions is how do I get my tu.exe to open before my AMS without causing errors. Thanks |
|
#5
|
||||
|
||||
|
Quote:
Code:
result = File.Run("AutoPlay\\Update\\tu.exe", "", "", SW_SHOWNORMAL, true);
if (result == 5) then
Application.Exit(0);
end
|
|
#6
|
||||
|
||||
|
ok
No, what i meant was IF I use the code below which is what I was using then the Update comes up behind my AMS. I want them to open my AMS and if then tu.exe runs and if there is no update then it opens the AMS, but if there is an update then it updates, patches and then opens the AMS.
WAS USING THIS: result = File.Run("AutoPlay\\Update\\tu.exe", "", "", SW_SHOWNORMAL, false); TRIED USING THIS AND AM HAVING ERRORS: result = File.Run("AutoPlay\\Update\\tu.exe", "", "", SW_SHOWNORMAL, true); if (result == 5) then Application.Exit(0); end |
|
#7
|
||||
|
||||
|
Quote:
what is it that you're trying to update? My guesses were that you are loading AMS, ams is then shelling to TU and waiting for it's return; and if it returns a value of 5 AMS then also exits. You either need to exit AMS before you attempt to update, or have whatever it is that you're calling to update (VP or SUF, MSIF) needs to wait until ams is closed down -- that is; if you are updating ams -- you still haven't explained what you're updating... One scenerio would be this: Launch AMS AMS Laucnhes TU TU, if an update is available, launches VP or SUF TU returns an error cdoe to indicate an update is avaialble AMS evaluates the return code, if it is 5, AMS exits VP/SUF senses that AMS is now closed, and processes the patch/update VP/SUF, once done, re-launches AMS <repeat> until no more updates. |
|
#8
|
||||
|
||||
|
Yes AMS is launching TU.
I have all of what you listed below and am using VP except when AMS is waiting and a patch is available I'm not sure how to return a code to my AMS to shut it down and then run the patch. Quote:
|
|
#9
|
||||
|
||||
|
When TU 'senses' that an update is available; it downloads it, once downloaded -- it runs that VP download, Right? you can find that code...
so -- When TU launches VP, TU does not "wait for vp to finish" instead, it launches, the immediately returns / exits with the code of 5 - to signal AMS to 'exit' Situation where no update exists
Situation where an update exists
btw: if you're trying to update an AMS executable on a cd or dvd -- all bets are off.... Last edited by jassing; 09-25-2008 at 01:38 PM. |
|
#10
|
||||
|
||||
|
so I dont need to wait for a response but leave the result like below?
result = File.Run("AutoPlay\\Update\\tu.exe", "", "", SW_SHOWNORMAL, false); if (result == 5) then Application.Exit(0); end |
|
#11
|
||||
|
||||
|
Quote:
see #2 in my example lists - #2 for "update available" and "no update" are the same. |
|
#12
|
||||
|
||||
|
Sorry I missed that.
Ok so it waits for TU to send it an error code. I'm not sure how to do that. I am in my TU but I'm not sure wehre to change it not to wait. Is it below? -- The full path and filename of the file to run local FileToRun = g_PatchFileDestFolder.."\\"..file; PatchReturnCode = File.Run(FileToRun, g_PatchCommandLineArgs, g_PatchWorkingFolder, SW_SHOWNORMAL, g_WaitForPatch); error = Application.GetLastError(); |
|
#13
|
||||
|
||||
|
Quote:
Yes; in that, set g_WaitForPatch to false and add a line after the file.run to Application.Exit(5); |
|
#14
|
||||
|
||||
|
Thank You
Thank you so much for you help.
I got it to work. I did have to disable some code in my patch file that was checking to see if the AMS was still running before closing but it works now. Thank you so much for your help. |
|
#15
|
||||
|
||||
|
Quote:
if it were I, i would include checks in the VP executable to check for, and if it's running wait; otherwise, continue on -- even with tossing up a statusdlg to say "Please exit ams" but if it's working; that's what's important -- the fine tuning can happen later. |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HOWTO: Distribute an AutoPlay Application with Setup Factory 6.0 | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-25-2002 03:33 PM |
| PROBLEM: AutoPlay Application Does Not Start Automatically | Support | AutoPlay Menu Studio 3.0 | 0 | 10-25-2002 03:21 PM |
| PROBLEM: AutoPlay Application Does Not Start Automatically | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-25-2002 01:39 PM |
| INFO: Dynamically Resizing an Application at Runtime | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-21-2002 03:23 PM |
| HOWTO: Make an AutoPlay Application Expire | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-09-2002 11:10 AM |
All times are GMT -6. The time now is 07:54 PM.









Linear Mode

