1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

File Changer

Discussion in 'Tools programming' started by Southwest, 9/5/09.

  1. Southwest

    Southwest

    Joined:
    1/12/07
    Messages:
    1,085
    Country:
    unitedkingdom
    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 ?

    [​IMG]
  2. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,300
    Country:
    netherlands
    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.
  3. Southwest

    Southwest

    Joined:
    1/12/07
    Messages:
    1,085
    Country:
    unitedkingdom
    Ah right thanks Arno,

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

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    24,716
    Country:
    wales
    Which programming language are you using?

    Ah VB.Net I think
  5. Southwest

    Southwest

    Joined:
    1/12/07
    Messages:
    1,085
    Country:
    unitedkingdom
    I think its Vb.net yep.

    Regards
  6. Southwest

    Southwest

    Joined:
    1/12/07
    Messages:
    1,085
    Country:
    unitedkingdom
    I would appreciate any help with the code.
  7. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    24,716
    Country:
    wales
    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
  8. Southwest

    Southwest

    Joined:
    1/12/07
    Messages:
    1,085
    Country:
    unitedkingdom

    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:


    [​IMG]
    Last edited: 10/5/09
  9. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    24,716
    Country:
    wales
    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.
  10. Southwest

    Southwest

    Joined:
    1/12/07
    Messages:
    1,085
    Country:
    unitedkingdom
    Ok, Though not to worry, i have developed the code, and the program now works perfectly.

    Thanks

Share This Page