SetupBuilder Community  

Go Back   SetupBuilder Community > SetupBuilder Software Installation System > SetupBuilder - NNTP

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2010, 08:26 AM
NewsArchive NewsArchive is offline
Senior Member
 
Join Date: Jan 2005
Posts: 27,191
Default How to detect a web update installation

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
Reply With Quote
  #2  
Old 10-17-2010, 08:26 AM
NewsArchive NewsArchive is offline
Senior Member
 
Join Date: Jan 2005
Posts: 27,191
Default Re: How to detect a web update installation

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
Reply With Quote
  #3  
Old 10-17-2010, 08:28 AM
NewsArchive NewsArchive is offline
Senior Member
 
Join Date: Jan 2005
Posts: 27,191
Default Re: How to detect a web update installation

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
Reply With Quote
  #4  
Old 10-17-2010, 08:29 AM
NewsArchive NewsArchive is offline
Senior Member
 
Join Date: Jan 2005
Posts: 27,191
Default Re: How to detect a web update installation

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
Attached Images
 
Reply With Quote
  #5  
Old 10-17-2010, 08:29 AM
NewsArchive NewsArchive is offline
Senior Member
 
Join Date: Jan 2005
Posts: 27,191
Default Re: How to detect a web update installation

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
Reply With Quote
  #6  
Old 10-17-2010, 08:30 AM
NewsArchive NewsArchive is offline
Senior Member
 
Join Date: Jan 2005
Posts: 27,191
Default Re: How to detect a web update installation

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
Reply With Quote
  #7  
Old 10-17-2010, 08:30 AM
NewsArchive NewsArchive is offline
Senior Member
 
Join Date: Jan 2005
Posts: 27,191
Default Re: How to detect a web update installation

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
Reply With Quote
  #8  
Old 10-18-2010, 02:20 AM
NewsArchive NewsArchive is offline
Senior Member
 
Join Date: Jan 2005
Posts: 27,191
Default Re: How to detect a web update installation

Oh! Thanks Friedrich. I will try it.

John
Reply With Quote
  #9  
Old 10-18-2010, 02:20 AM
NewsArchive NewsArchive is offline
Senior Member
 
Join Date: Jan 2005
Posts: 27,191
Default Re: How to detect a web update installation

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
Reply With Quote
  #10  
Old 10-19-2010, 12:02 AM
NewsArchive NewsArchive is offline
Senior Member
 
Join Date: Jan 2005
Posts: 27,191
Default Re: How to detect a web update installation

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


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Forum Jump


All times are GMT -6. The time now is 05:38 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2004-2012 Lindersoft