PDA

View Full Version : File Changer


Southwest
09 May 2009, 11:02
Hi All,

I am trying to develop a tool that would allow the user to switch between two different glideslopes at a certain airport i', developing, i wasnted the tool, depending on what the user selects to install the correct .bgl file into the scenery folder, is that possible ?

If so, is there any tutorials anyway that say about creating this kind of code, this is what i have so far, using Microsoft Visual 2008 to do so. The graphical interface is shaping up, ish. The idea would be that the user selects the scenery folder where the .bgls are kept, and the addon scenery/scenery folder where the .bgl would be moved, they then select the glideslope that they wanted, and the relevant .bgl would be installed.

Any thoughts please ?

http://img23.imageshack.us/img23/2743/49449624.jpg

arno
09 May 2009, 12:39
Hi,

For the project I work on we included an application indeed that would copy certain files in and out based on user preference. For example to add certain features or to get better performance.

Basically that tool just has some buttons where the user selects what he wants, all the other things happen automatically.

From programming point of view it is quite easy, you just need to move some files.

Southwest
09 May 2009, 14:26
Ah right thanks Arno,

Though isn't the code's difficult, i can't find any tutorials or help on the subject ?

scruffyduck
09 May 2009, 16:50
Ah right thanks Arno,

Though isn't the code's difficult, i can't find any tutorials or help on the subject ?

Which programming language are you using?

Ah VB.Net I think

Southwest
09 May 2009, 17:09
I think its Vb.net yep.

Regards

Southwest
10 May 2009, 06:09
I would appreciate any help with the code.

scruffyduck
10 May 2009, 08:49
So to be clear you are looking for help with code in VB.Net to move files from one location to another. Or is your aim to copy one or more files from a backup folder into the target folder depending on the user choice? So the process would be

Remove the existing file(s) from the target folder
Copy files depending on user choice from the backup folder to the target folder



Or is this to just happen once when the user installs their choice?

Perhaps if you give us a description of the steps needed then we can help a bit more

File handling in dot NET is done via the System.IO namespace

Southwest
10 May 2009, 09:42
So to be clear you are looking for help with code in VB.Net to move files from one location to another. Or is your aim to copy one or more files from a backup folder into the target folder depending on the user choice? So the process would be

Remove the existing file(s) from the target folder
Copy files depending on user choice from the backup folder to the target folder



Or is this to just happen once when the user installs their choice?

Perhaps if you give us a description of the steps needed then we can help a bit more

File handling in dot NET is done via the System.IO namespace


Yes please, I want the user to be able to move the file selected from one folder to another.

The user would download and install my package the file structre would be something like this, Addon Scenery\Plymouth City Airport\ Scenery, Texture & Options folders.

Inside the options folders are two .bgl files that contain different scenery data which the user would install depending on which approach lights they wanted installed, I wanted if possible the installer to be able to pick up the file, whichever the user wanted, and drop it into the \Plymouth City Airport\ Scenery folder.

I believe this is part of the code that i need to have: My.Computer.FileSystem.CopyDirectory("sourcefolder", "destinationfolder", True) though i'm not sure what object to place it on ?

Here is an image of the installer user interface:


http://img6.imageshack.us/img6/1073/46555103.png

scruffyduck
10 May 2009, 10:19
I think you should be doing this with an installer then. It looks like you are writing your own but to be honest there are several very good freeware installers that will do this.

If you take as an example the installer used for ADE (developed by Martin Gossman) and using a freeware installer you will see that we offer options to both download optional files, install or not install elements and much more. I am sure Martin would be able to help if you chose that route.

Southwest
11 May 2009, 07:32
Ok, Though not to worry, i have developed the code, and the program now works perfectly.

Thanks