Re: Networking installation
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
Re: Networking installation
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
Re: Networking installation
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
Re: Networking installation
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
Re: Networking installation
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
Re: Networking installation
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
Re: Networking installation
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
Re: Networking installation
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
Re: Networking installation
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