PDA

View Full Version : Networking installation



NewsArchive
10-08-2007, 01:44 AM
Currently all my apps are standalone. I am now enabling Replicate in all my
apps so my SB installer needs to be modified to cater for the data folder
location.

I will have a window to ask if they are a multi user. If not then I default
to the scenario I use now and install the data to CSIDL_COMMON_DOCUMENTS .
In my code I setup the data path using:

GLO:DataPath = Clip(ds_GetFolderPath(WE::CSIDL_COMMON_DOCUMENTS)) &
'\Company Name\Application Name'

Now I am using Replicate I will need to change my code to point NOT to a
local folder but another folder. Not a problem.

In the installer, would it best, if a multi user, to allow them to select
the data folder and then enter that folder into the registry for each local
machine? This means that everyone has to make sure that they enter the same
folder of course. My handcode then be modified to use the registry value
instead of CSIDL.

Or is there a more automated way of doing this?

I am just trying to remove as much of the manual choices as possible in my
SB script. The standalone app really has very little room for the user to
make changes but I think a network application needs to have that
flexibility.

Bottom line - the standalone users tend to be completely computer illiterate
so providing choice is dangerous. The network users will be computer
literate or employ someone who is so should be able to manage the install
safer.

I am just worried that someone on the network could install and select
another folder for the location of the data to other users!

BTW If they are running a "central" copy of the software using dumb
terminals then all is OK but I suspect that most will be running local
copies in the office but using the central data repository.

TIA

John Fligg

NewsArchive
10-08-2007, 01:44 AM
A few issues you'll want to sort out::

1. Will the app itself reside on local hard drives or on the server?
2. Will users have a mapped drive to the data on the server, or access it
via a UNC path? It can be hard to require that all computers on a LAN use
the same letter for your mapped drive.
3. On apps residing on a server, I've used " .\MyDataFolder " as a data
path. That way, if they can find the .exe they can find the data.
4. Be sure permissions on the server are set correctly (both Share and NTFS
permissions).
5. I haven't used Replicate. But unless I'm having more of a brain fade
than usual, I don't understand why you are doing so in this scenario. As I
understand it, Replicate would be used to keep databases at different sites
current with each other. If machines on a LAN are sharing common data, they
should all be reading/writing to a common network share.

Jane

NewsArchive
10-08-2007, 01:45 AM
Thanks Jane

First of all you are NOT haveing a brain fade. I am <g>. Replicate has
nothing to do with it. It just happens that I am working on that and
suddenly realised that my latest application will very probably run in a
network environment. It runs OK in the office because I can simulate things
here and set it up myself.

However if this is going out to the world I need something pretty watertight
and at the moment my isntaller only assumes installating to a local machine
on a standalone basis.

Do you or anyone else have a sample networking setup SB script I could have
a look at to check out all the possibilities. I am worried I may have bitten
off ore than I can chew here!

John

NewsArchive
10-08-2007, 01:45 AM
I just had another thought Jane.

Would it be OK to force everyone to have the app run on a server for now?
That way my app really would not need changing as I too use the
\MyDataFolder method and set the data pathname to CSIDL......

So similarly, if they can find the exe then the exe can find the data path.

John

NewsArchive
10-08-2007, 01:46 AM
You need to rethink using CSIDLS when running on a network.
For example, if I'm logged onto a workstation on a network, my
CSIDL_COMMON_DOCUMENTS will "probably" resolve to C:\Documents and
Settings\All Users\Documents on my local workstation if I'm using an XP
machine. Active Directory networks may use folder redirection to locate an
individual user's profile onto a server. I don't *think* that the All Users
is subject to redirection.

So if you're having multiple users share a database file on a server, I
think you're better off establishing a fixed path on the network and not
trying to make CSIDLs work for that. Hence my suggestion that you make a
DATA folder in the server folder where your app will be installed, and use
the period backslash to set your data file paths to .\DATA\whatever.tps.

Jane

NewsArchive
10-08-2007, 01:46 AM
Ah - I see Jane. Got you.

As my dct path names are already qualified as \DATA then I *think* that if I
remove the CSIDL stuff in my app at startup it should work.

The trouble is that there are ini files and other stuff that use the CSIDL
method so I need to check all those.

Hmmmm.

Thanks

John

NewsArchive
10-08-2007, 01:46 AM
Oh but hang on Jane - can you use a DATA folder as a sub folder in Vista. I
think not.

So what happens if the server is Vista?????

John

NewsArchive
10-08-2007, 01:47 AM
LOL... when I hear "server", I tend to think more Server 2003 than a
desktop OS.

If you're using a Vista machine as a "server" I think you have a couple of
choices.
1. Create a folder that's not inside C:\Program Files for your app and
data. Share it and do your thing.
or
2. Install your app into C:\Program Files on the "server". Use the
COMMON_DOCUMENTS on the server for your data. Share your data folder (one
of my last Clarionmag articles explains some of the gotchas involved in
sharing folders within the Public structure in Vista). Then your app will
need to know whether it's running locally on the server (in which case it
can use the CSIDL to find the data) or if it's on a remote machine, in which
case it will need to use a shared drive or UNC path.

Jane

NewsArchive
10-08-2007, 01:47 AM
Gee - I think I am getting into something I really don't want to. I really
have very little experience of "servers".

I see that SB caters for all this but no idea where to start. Do you or
anyone else have any examples or tell me where I might find some to get some
ideas.

Questions I have no idea how to answer for example include:

1. How does Clarion code handle a UNC path and how do you know when to use
it
2. How does SB know if it is installing to a server or workstation
3. Can you convert a pathname in SB to UNC if needed
4. Ditto in Clarion

It's all geting a bit scaryto be honest. I am willing to learn and try but
not really sure where to start with all this.

I am not very keen on NOT using program Files as I have been down that route
with my standalone apps and I believe I should really be using Program Files
so looks like I have some significant problems to overcome.

Many thanks

John

NewsArchive
10-10-2007, 02:48 AM
John,

This is the code I use in my exe at startup to define all I need

GLO:RepWindows =
GETREG(REG_LOCAL_MACHINE,'SOFTWARE\MICROSOFT\WINDO WS\CurrentVersion\SETUP','WinbootDir')

LOC:MesDocuments =
GETREG(REG_LOCAL_MACHINE,'SOFTWARE\MICROSOFT\WINDO WS\CurrentVersion\Explorer\Shell
Folders','Personal')
IF LOC:MesDocuments = ''
LOC:MesDocuments =
GETREG(REG_LOCAL_MACHINE,'SOFTWARE\MICROSOFT\WINDO WS\CurrentVersion\Explorer\Shell
Folders','Personal')
END

IF GLO:RepWindows = ''
GLO:NT = 1
GLO:RepWindows = GETREG(REG_LOCAL_MACHINE,'SOFTWARE\MICROSOFT\WINDO WS
NT\CurrentVersion','SystemRoot')
GLO:RepSystem = CLIP(GLO:RepWindows) & '\SYSTEM32'
ELSE
GLO:NT = 0
GLO:RepSystem = CLIP(GLO:RepWindows) & '\SYSTEM'
END

GLO:RepOrigine = GETREG(REG_CURRENT_USER,'SOFTWARE\CGF\Suite
Comptable','Répertoire Installation')
IF GLO:RepOrigine = ''
GLO:RepOrigine = LONGPATH(PATH())
END

! as I have the possibility of opening multiple companies data I still do
not know which one is going to be opened so I keep only few important tps
files in the app dir and all others are in sub dirs (global variable names
in dct)
! I read the last opened company and username here
GLO:chemin_societe = GETREG(REG_CURRENT_USER,'SOFTWARE\CGF\Suite
Comptable','Société')
GLO:Utilisateur = GETREG(REG_CURRENT_USER,'SOFTWARE\CGF\Suite
Comptable','Utilisateur')

! if both these values are empty then fresh install or first opening on
client machine (NO app path and no user name)
IF GLO:chemin_programme <> '' AND GLO:Utilisateur = ''
PUTREG(REG_CURRENT_USER,'SOFTWARE\CGF\Suite
Comptable','Utilisateur','ADMINISTRATEUR')
END

! Initialisation
IF GLO:chemin_programme = '' AND GLO:Utilisateur = '' AND
GLO:chemin_societe = ''
PUTREG(REG_CURRENT_USER,'SOFTWARE\CGF\Suite
Comptable','Société',CLIP(GLO:chemin_societe))
PUTREG(REG_CURRENT_USER,'SOFTWARE\CGF\Suite
Comptable','Utilisateur','ADMINISTRATEUR')
PUTREG(REG_CURRENT_USER,'SOFTWARE\CGF\Suite Comptable','Chemin
Programme',CLIP(GLO:RepOrigine))
GLO:Utilisateur = 'Administrateur'
END

GLO:chemin_programme = GETREG(REG_CURRENT_USER,'SOFTWARE\CGF\Suite
Comptable','Chemin Programme')
IF GLO:chemin_programme = ''
PUTREG(REG_CURRENT_USER,'SOFTWARE\CGF\Suite Comptable','Chemin
Programme',CLIP(GLO:RepOrigine))
GLO:chemin_programme = GLO:RepOrigine
END

! Sélection de dossier (this procedure is the one were the user selects
his company to open
SELSOC
! that procedure has a double path : ie company A has a normal path plus
an UNC one \\servername\shared_dir_name\company_dir_name and all is fine

! here I read all global variables as now I know which company has to be
opened so I can prime my variables for all data files
CHEMFIC
! like this one for languages
GLO:tps_langues = CLIP(GLO:chemin_societe) & UPPER('\langues.tps')

Access:LANGUES.Open
Access:LANGUES.UseFile

IF ERRORCODE() = 02
COPY(CLIP(GLO:chemin_programme) &
'\zip\langues.tps',CLIP(GLO:chemin_societe) & '\langues.tps')
END

LOC:CheminOrigine = GETREG(REG_CURRENT_USER,'SOFTWARE\CGF\Suite
Comptable','Répertoire Installation')

! Serveur Mise a Jour des Fichiers
IF LEFT(LOC:CheminOrigine,2) <> '\\' ! Maintenance sur serveur et non sur
Poste de Travail Réseau
GLO:chemin_data = GETINI('CGF','Data','','.\CGF.INI')
etc .....

if the installer has written in reg that the SB_INSTALLDIR is on LAN then it
will be a UNC path meaning it starts with a double backslah \\ and you can
use that value as I do
otherwise on a single machine install or on the "server" side the installdir
will be a normal one (no double backslash)

JP
--
Merci - Thank you

JP

NewsArchive
10-11-2007, 01:19 AM
Hi John,

>I am not very keen on NOT using program Files as I have been down that route
>with my standalone apps and I believe I should really be using Program Files
>so looks like I have some significant problems to overcome.

Our Network Class which is part of our Utilities does UNC paths
including using local shares. This means that you can get the correct
UNC path for the computer where the program is running and it will be
the same for all computers on that network. Our SetupBuilder class
(which will be in the next release of the Utilities - around this
weekend) has methods to copy data from a global area to a local area
(i.e. from CSIDL_COMMON to CSIDL_LOCAL) and some other cool stuff that
makes installs easier.

Best regards,

Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com


Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php