Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
8
Erster Beitrag:
vor 5 Jahren
Letzter Beitrag:
vor 5 Jahren
Beteiligte Autoren:
DarrenF, Fabrice Harari, Al, stefan.kern

[WD17] Live and Test System on same PC...

Startbeitrag von DarrenF am 13.04.2013 11:59

Hi guys,

I'm trying to setup my application twice on the same (server) PC - 1 - as a Test/Training version and 2 - as the Live system. I want the Test/Training system to be independant of the Live system for obvious reasons.

I'm also trying to use the same Install package for both versions - which seems to work, but you have to remember to change the install paths (folders) manually when installing the apps. It would be great if there was a way to have 2 different install packages per WD Project, but I can see a way of doing it.

So, I install my system to 2 seperate folders in the Program Files and I use HChangeDir to point to the required data.

However, I have a couple of questions:

1) Do you guys have any general advice on how to operate a Test/Training and a Live system in tandem but totally independant of each other?

2 Some fields on the windows are set to Store values and when I change a "stored value" on the Test system, when I run the Live system, the value has changed there also - where are these stored values held?
Thanks...

Antworten:

Hello Darren,

I don't follow the rules about installing into the Windows Program Files and then have my data in a separate filder, I just install everything into the one folder on the server so each copy (Live or Training) is complete with eveything it needs and this works fine with HF classic, but I would have to do what you do for HFCS

The stored values go into the registry and use the app name to create a registry folder name so with two versions using the same app name, there is only one copy of the values. There is a ProjectInfo(piRegistry) that tells you the registry folder for a project. You can use ini files to hold the "stored values" rather than the registry using the IniParameter() function or you can set a specific registry folder in the project init code so...
InitParameter(paramRegistry, "HKEY_CURRENT_USER\Software\MyAppName\Training")
You could use exeinfo() to get the exe name or projectinfo() to get the projectname to use in the registry setting.
LProjName is string = NoSpace(ProjectInfo(piProjectName))
If you do this and change the registry location for the current project, it will start a fresh copy of the settings in all your current installations and they will lose their settings

ProjectInfo() is better than exename() because in test mode the exe name is WDTest.exe


Regards
Al

von Al - am 13.04.2013 12:39
Hi Darren,

just an idea:
You find in the examples the complete WDSETUP, which can be modified.
Maybe you can modify it according to your needs.

I do not know why you need two versions, but I have also one of my programs installed on the same machine as production and as test/demo version.

I just installed the demo on a virtual machine. The VM allows snapshots, so I can prepare the application for a customer presentation, take a snaphot, do the presentation and after that, I set the machine back to the snapshot and the VM is in the same state as before the presentation.

Best Regards

Stefan.

von stefan.kern - am 13.04.2013 14:00
Hello Darren

to do what you want, there isno need to install TWICE the same program... You just need two different DATASETs...

So you can just add at the beginning of your program a choice window: Training DB, Real life DB.

If you are using HF classic, that's 2 different diretories, if you are using HFSQL, it's two differently named DB.

Now about the your second question, the stored values are set by default to be stored in the registry, in a key based on the name of your app... What you need to do is change the default behavior to say that they should be stored in an XML file (3 options available: registry wont work as only ONE, ini file wont work as limited to 64 kb, so you need the xml)... I can't remember the instruction from the top of my head, but I'm sure you can find it in the help as well as I could :-)

So in your choice window, once one option is selected, you switch to the correct DB and to the correct xml file and you are done... You can even have on the same machine SEVERAL training sessions (different users with compltely different dataset)...

In fact, in some cases, you want to add an "initial" DB that serves as a starting point for your training session... IN tat case, you need a new DB creation mechanism that will copy your initial DB.

Best regards

von Fabrice Harari - am 13.04.2013 14:01
Thanks for the replies guys...

Al - Hmmm, so (as I'm beginning to realise), it's not as straight forward as I first thought. Not sure I follow; "everything into one folder"? The reason I'm doing this, is to seperate the 2 versions, so the process is to install into Test/Training and test it (becuase at the same time, the output from my app produces files that are used to test a web site). When everything is "ok", then the app will then be installed into the Live area. The other issue with using the same Installer is that I also put an icon on the Desktop which doesn't help either... :confused:

Stefan, In general my customer wants an environment where he can try things out, test new releases before they go into Live, train staff to use the system etc... I'm looking for as simple a solution as possible. I already thought about changing the Installer baased on Test or Live, but ruled it out based on the amount of work. Hmmm, VM, I'll look into that a bit further - thanks for the idea :spos:

Fabrice, I do need 2 versions of the code because the code might be different in the 2 areas as I want to also use the Test environment just as that - an environment where code can be tested before it goes Live. I know I test in my dev environment, but there are things that aren't as easy to test in dev, such as data feeds I send to the customers web site - the web site has a test environment as well. It seems if I can solve the "stored values" issue (using XML?), then that might just work - I wasn't aware of that - thanks!

Thanks again guys for getting involved, and I know I always say this, but I really do appreciate your comments! :cheers:

von DarrenF - am 13.04.2013 15:52
Hello Darren

What I do only works for HF Classic, but I put everything - fic,ndx,mmo,windev dll's and my app exe into single folders on the server. So there is one folder for live and another for training, and each one is totally self contained.

Those two folders are inside another folder which has a drive mapped to it so the path is either x:\myapp\live or x:\myapp\training.

If clients are running over a Lan they have shortcuts on their desktop to each of the exes in the server folders. Citrix and Terminal Server clients, run either the production or live exe on the server from shortcuts on their session desktop.

For HFCS you would need to do as Fabrice suggests with two datasets, but you could still have two sets of code in different folders

In both scenarios, you can use the IniParameter() function to either create separate xml files or separate registry folders for live an dtraining to hold stored values.

Regards
Al

von Al - am 13.04.2013 23:13
Hmmm, interesting Al... wasn't really aware of this function...

Just testing it and I've decided to test using the XML option because it's easier to see the results. I added it to my code, and as the Help states, an XML file is created in the EXE folder. When I ran my app, only some of the fields with the "Store the value" checbox set have their values in them :confused:

I've browsed the XML file and it seems to have a lot of data in it, so I can only assume that it's populated it from the existing Registry entries? ...maybe?

The Help is very "light" in this area and doesn't really describe what to expect - you don't happen to know how all this works do you?

In summary; I can see it populating some fields that previously had values and others (that have "Store the value" checked) don't have values populated, but when I set a value exit my app and run the app again - the values are there, so as far as I can see, it's "kind of" working but not fully :confused:

von DarrenF - am 15.04.2013 20:24
Hi Darren

First the XML does not have to AND SHOULDN'T BE in the exe directory... You can and should give it a different path/name for each case.

Second, AFAIK, it is filled when exiting the program, not during execution... In fact, it's working the exact same way it was working before, except that now it's not stored in the registry any more.

Best regards

von Fabrice Harari - am 16.04.2013 12:15
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.