Indigo Rose Software
  #1  
Old 09-24-2008
Dnixon's Avatar
Dnixon Dnixon is offline
Indigo Rose Customer
 
Join Date: Jun 2007
Posts: 94
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.
Reply With Quote
  #2  
Old 09-24-2008
Ulrich's Avatar
Ulrich Ulrich is offline
Indigo Rose Staff Member
 
Join Date: Apr 2005
Location: Sao Paulo, Brazil
Posts: 823
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
Reply With Quote
  #3  
Old 09-25-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by Dnixon View Post
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.

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...
__________________
Reply With Quote
  #4  
Old 09-25-2008
Dnixon's Avatar
Dnixon Dnixon is offline
Indigo Rose Customer
 
Join Date: Jun 2007
Posts: 94
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
Reply With Quote
  #5  
Old 09-25-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by Dnixon View Post
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.
You don't have it wait? then what is calling this code:
Code:
result = File.Run("AutoPlay\\Update\\tu.exe", "", "", SW_SHOWNORMAL, true);
if (result == 5) then 
Application.Exit(0);
end
__________________
Reply With Quote
  #6  
Old 09-25-2008
Dnixon's Avatar
Dnixon Dnixon is offline
Indigo Rose Customer
 
Join Date: Jun 2007
Posts: 94
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
Reply With Quote
  #7  
Old 09-25-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by Dnixon View Post
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.
but you're said that AMS isn't calling TU -- so what is calling TU?
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.
__________________
Reply With Quote
  #8  
Old 09-25-2008
Dnixon's Avatar
Dnixon Dnixon is offline
Indigo Rose Customer
 
Join Date: Jun 2007
Posts: 94
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:
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.
The reason I was using the number 5 was because I thought if it prompts them to update and they hit cancel it sends the return code 5. That is why I was saying if 5 exit. How do I send the return code if there is a patch available??
Reply With Quote
  #9  
Old 09-25-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
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
  1. AMS starts up
  2. AMS launches TU and waits
  3. TU checks and finds no update, exits normally returns 0
  4. AMS sees return code and continues to load

Situation where an update exists
  1. AMS starts up
  2. AMS Launches TU and waits
  3. TU checks and downloads the VP update
  4. TU then launches the VP update, but does not wait for it's return
  5. TU exits with code of 5
  6. AMS sees the return code of 5 and exits


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.
Reply With Quote
  #10  
Old 09-25-2008
Dnixon's Avatar
Dnixon Dnixon is offline
Indigo Rose Customer
 
Join Date: Jun 2007
Posts: 94
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
Reply With Quote
  #11  
Old 09-25-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by Dnixon View Post
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

see #2 in my example lists - #2 for "update available" and "no update" are the same.
__________________
Reply With Quote
  #12  
Old 09-25-2008
Dnixon's Avatar
Dnixon Dnixon is offline
Indigo Rose Customer
 
Join Date: Jun 2007
Posts: 94
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();
Reply With Quote
  #13  
Old 09-25-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by Dnixon View Post
Ok so it waits for TU to send it an error code. I'm not sure how to do that.
have a look at Application.Exit()

Quote:
Originally Posted by Dnixon View Post
I am in my TU but I'm not sure wehre to change it not to wait. Is it below?
Yes; in that, set g_WaitForPatch to false and add a line after the file.run to Application.Exit(5);
__________________
Reply With Quote
  #14  
Old 09-25-2008
Dnixon's Avatar
Dnixon Dnixon is offline
Indigo Rose Customer
 
Join Date: Jun 2007
Posts: 94
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.
Reply With Quote
  #15  
Old 09-25-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by Dnixon View Post
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.
You're welcome. W/o know what code you had in there; there is no way I could know of the need to disable anything.. just the basic "how to" at a high level.

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.
__________________
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software