View Full Version : How to detect a web update installation
NewsArchive
10-17-2010, 08:26 AM
I have a demo install and use #pragma disablewebinstall to derive 2
installs, one for CD and the other for web update.
The client can now update using the demo on CD or downloaded off our website
OR from within the application by using wudate.exe
When update runs then it in effect runs the demo but detects an existing app
and switches into maintenance mode.
But how can I detect at runtime if the web update version is running?
TIA
John Fligg
NewsArchive
10-17-2010, 08:26 AM
BTW if it helps I am asking as I need to hide certain dialog windows if it
is a web update but not if it is an update running off a CD for example.
John
NewsArchive
10-17-2010, 08:28 AM
Hi John,
>
> But how can I detect at runtime if the web update version is running?
>
Very easy. What you can do is to create a variable (e.g.
%THIS_IS_A_WEBUPDATE% and set it (at compile time) to 1 for a web update
version and to 0 if it is not a web update. Then you have the information
you need at runtime.
Hope this helps.
Friedrich
NewsArchive
10-17-2010, 08:29 AM
Erm not sure that is the solution Friedrich.
How can the clients machine detect that variable? Also how can you set a
variable according to a #pragma condition?
Maybe you misunderstand me as when I say detect at runtime I do not mean
when compiling (#pragma does that), I mean when the client runs the install.
So assuming the install is running on the client machine and has switched
into maintenance mode, I now need to know if these are the wupdate.exe
install files (0001 etc) or the demo.exe - hope that makes sense.
See attached code.
I use this code in conjuction with Build Automator. All is does is tells SB
to compile the script as though it were not a web install.
So at this point I would need to set this variable but how? Remember I am in
effect compiling the SAME SB project twice, once as a web install the other
not.
But I do not think setting the variable is the solution.
HTH
John
NewsArchive
10-17-2010, 08:29 AM
John,
> How can the clients machine detect that variable? Also how can you set a
> variable according to a #pragma condition?
Just handle the %THIS_IS_A_WEBINSTALL% logic in the code you posted and you
are done:
#ifcompvar [MANUAL_INSTALL] Equals "1" Then
#pragma DISABLEWEBINSTALL = "1"
Set Variable %THIS_IS_A_WEBINSTALL% to "0"
yadayada
#else
Set Variable %THIS_IS_A_WEBINSTALL% to "1"
#end
If you compile a web-install enabled updater, %THIS_IS_A_WEBINSTALL% will be
"1". If you compile an install that does not support web install,
%THIS_IS_A_WEBINSTALL% will be "0".
Hope this helps.
Friedrich
NewsArchive
10-17-2010, 08:30 AM
OK Friedrich but still not sure I understand.
So when the install runs on the clients machine the script will return the
value of the variable?
In other words, by putting that in the #pragma section the variable is
stamped into the installer???? I never knew you could do that!
Thanks
John
NewsArchive
10-17-2010, 08:30 AM
John,
> OK Friedrich but still not sure I understand.
>
> So when the install runs on the clients machine the script will return the
> value of the variable?
>
> In other words, by putting that in the #pragma section the variable is
> stamped into the installer???? I never knew you could do that!
You instruct the #ifcompvar compiler directive to do this! You can even use
this technique to add another wizard dialog logic or another set of files,
etc.
As I understand it, you create TWO different updater applications from the
SAME .sb7 project. One updater is web-install *ENABLED*, the other updater
is standalone and does not require an active Internet connection.
So let us assume, the updater.sb7 project compiled with [MANUAL_INSTALL] set
to "1" creates the web-install *DISABLED* version (no Internet connection
required). What you do here is, you simply define your own
%THIS_IS_A_WEBINSTALL% variable and set it to "0" at compile time. If this
updater is launched, your script logic knows that this is NOT a web install
(because the value of %THIS_IS_A_WEBINSTALL% is "0" at runtime).
Compile the very same updater.sb7 project with [MANUAL_INSTALL] set to "0"
creates the web-install *ENABLED* version. Now you let the #ifcompvar
compiler directive set %THIS_IS_A_WEBINSTALL% to "1" at compile time. If
this updater is launched, your script logic knows that this is a web install
(because the value of %THIS_IS_A_WEBINSTALL% is "1" at runtime).
Friedrich
NewsArchive
10-18-2010, 02:20 AM
Oh! Thanks Friedrich. I will try it.
John
NewsArchive
10-18-2010, 02:20 AM
Oh sorry Friedrich
Having read your reply, knowing I was missing something obvious I finally
got it after the 4th read through!
Of course, the script is compiled into an exe of some form and compiling it
the dialog's that is told to do. #pragma directs what to compile in.
Understood (at last). I knew it was obvious. I assumed (wrongly) that the
logic was being determined at runtime when it is actually determined at
compile time.
Thanks
John
NewsArchive
10-19-2010, 12:02 AM
John,
In the "Learning SetupBuilder Part I" document, there is some discussion of
the various types of variables and constants, and a topic called
"Setting Runtime Variables From Compiler Variables"
Jane
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.