PDA

View Full Version : Detect running App prob



NewsArchive
02-28-2009, 02:18 AM
Hello Friedrich,

when i run the webupdate from my webserver the webinstaller displays the
message that i should quit my running app but will not wait for quitting and
reboot my system?

Any idea what happen?

Thanks much

Kai

NewsArchive
02-28-2009, 02:18 AM
Hi Kai,

> when i run the webupdate from my webserver the webinstaller displays the
> message that i should quit my running app but will not wait for quitting and
> reboot my system?

If any files are active/locked/in use when the install runs, they are put
into temporary storage and the system rebooted and the install finished when
the system comes back up.

What I do in my application is first I run the webupdate to check for an
update with /S /C (if I remember correctly) and then based on the return
value I run the webupdate again and terminate my program. Here is a routine
that I use in my Build Automator:

CheckforWebUpdates ROUTINE
Data
Rc Long
Ec Long
PP CString(2049)
pF CString(50)
Code
pF = 'autoupdate.exe'
PP = Upper(ShortPath(ITU.ProgPath & '\' & pF))
If Exists(PP)
PP = '"' & ITU.ProgPath & '\' & pF & '"'
RC = ITU.ITRun(PP,true,'/C /S',,True) !! Elevate
If RC = 1
If Message('There are new updates to the Build Automator program
available for download. ' &|
'If you want to update the program, the program will shut
down automatically and ' &|
'run the web update wizard.' &|
'||Do you want to update the program now?',|
'Updates Available - download now?',|
'~RO-Mx1_internet-america.ico',|
Button:Yes+Button:No)=Button:Yes
ITU.ITRun(PP)
Halt()
End
Else
Message('No updates to download for the Build Automator','No new
updates','~RO-Mx1_internet-america.ico')
End
Else
If Message('The AutoUpdate.EXE file could not be found in the "' &
ITU.ProgPath & '" folder. ' &|
'Please download and install the latest build from
www.buildautomator.com. ' &|
'||Do you want to go to our download page now?',|
'Automatic update program not found.',|
'~RO-Mx1_internet-america.ico',|
BUTTON:Yes+BUTTON:No,BUTTON:Yes) = BUTTON:Yes
ITU.OpenUrl('http://www.buildautomator.com/downloads.php')
End
End

The interesting part for you is:

ITU.ITRun(PP)
Halt()

The first one fires off the webupdate and the second one terminates the
program. I have been using this with good results for the past few years
with projects including the web update.

Best regards,

--
Arnór Baldvinsson - Icetips Creative, Inc.
Port Angeles, Washington
www.icetips.com - www.buildautomator.com

Icetips product subscriptions at http://www.icetips.com/subscribe.php

NewsArchive
02-28-2009, 02:19 AM
Hello Arnor,

thanks much. But i have some compile errors.

What i need to do with UTS

For ITS you tell me to put

ITS ITShellClass

in the Data Embed.

The same with UTS?

Best regards

kai

NewsArchive
02-28-2009, 02:19 AM
Hi Kai,

> What i need to do with UTS
>
> For ITS you tell me to put

>> PP = Upper(ShortPath(ITU.ProgPath & '\' & pF))

In this case ITU is an instance of the ITShellClass so it's ITS and ITU is
the same:)

Best regards,

--
Arnór Baldvinsson - Icetips Creative, Inc.
Port Angeles, Washington
www.icetips.com - www.buildautomator.com

Icetips product subscriptions at http://www.icetips.com/subscribe.php

NewsArchive
03-01-2009, 07:46 AM
Hi Arnor,

it works like a charme :-)

Thanks much!!!

Kai

NewsArchive
03-01-2009, 07:47 AM
Kay,

> when i run the webupdate from my webserver the webinstaller displays
> the message that i should quit my running app but will not wait for
> quitting and reboot my system?
>
> Any idea what happen?

What Arnór said. But there is definitely a bug in your "active application
detection" logic. I assume you are not using it in a Loop to make sure the
application terminated.

Similar to this:

http://www.lindersoft.com/forums/showthread.php?p=10385#post10385

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
03-01-2009, 07:48 AM
Hi Freidrich,

i have done this but have no idea because the file will not detected.

But i have tried arnors call from within the app an this will work very well for my :-)

Best regards

kai

NewsArchive
03-01-2009, 07:48 AM
> i have done this but have no idea because the file will not detected.
>
> But i have tried arnors call from within the app an this will work very
> well for my :-)

I don't think the reboot has anything to do with an active application in
your case. If "Detect Active Application" returns "0" then your application
is definitely not active. There is another cause for the reboot.

Friedrich

NewsArchive
03-01-2009, 07:48 AM
Hello Friedrich,

this issue is gone away with using %curdir% in my update.

Thanks much

Kai