Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

XML help

Options
  • 16-08-2007 2:02pm
    #1
    Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭


    Hey, I am trying to create directories in xml, and have done so. I started learning xml yesterday, so not great at it obviously.
    This is hundreds of lines of code when you take into account all the sub folders etc.
    <Directory Id="shutdownScripts" Name="shut" LongName="shutdownScripts">
                    <Component Id="C_FL_default.cmd3" Guid="{1A065B11-0D06-4223-A6AA-A8198F0BE556}">
                      <File Id="FL_default.cmd3" Name="default." LongName="default.cmd" Source="inputfiles\native\shutdownScripts\default.cmd" DiskId="1" KeyPath="yes" />
                    </Component>
    
    etc.
    What is the best way to create these directories? Some sort of recursive thing?
    It is for an installer which will change as time goes on, so it would be better to write some code so that I do not have to go back and change it when new files/folders are added to the installer. Something that automatically reads from the main folder and creates the directories?


Comments

  • Registered Users Posts: 85 ✭✭slavigo


    I afraid I didn't fully get what your looking for above.

    Are you saying that you have an xml file that acts as a kind of configuration file that defines a directory structure.

    Then, as part of some applications installation process, you want something to parse the xml and generate the directory structure that is denoted by the xml?

    And your question is, something along the lines of, "Whats the best way to write some generic code that can handle this xml and the possible permutations as the required directory structure gets more complicated and from the xml generate the directory structure?".


  • Registered Users Posts: 2,781 ✭✭✭amen


    forget the xml describe in english (wth an example) what you are trying to do.
    Many ways to skin a cat


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    I have files in a folder. I created an MSI in XML to bundle them up in an installer.I now have an installer that will install these files to a folder and subfolders in that folder.
    I manually created all these folders and files in XML, one by one, which took ages. There could be thousands oif files in an installation.
    This is a problem for further development. I need the xml program I write to basically read from a designated folder, that I am taking these files from when I run the program, and generate an MSI with all the relevant structure of directories intact.
    Basically I want some sort of wildcard search thing that reads all the files from one folder and puts them in my program, instead of giving the location of every file I need to install.
    So I don't have to keep including files in my program by giving hard links like:
    C:\wixproj\pcs\inputfiles\a.exe
    C:\wixproj\pcs\inputfiles\b.dll
    C:\wixproj\pcs\inputfiles\c.m11
    C:\wixproj\pcs\inputfiles\d.cfg
    etc

    Anybody follow? :/


    I also have another query.
    I can add a folder to the shortcuts at start->all programs->myprogramname-> folderlinkhere
    but it is only a link to a folder.
    So, I am trying to put a userguide.pdf where folderlinkhere is, but it is just a folder I can get there(with the user guide in it). Using the code:
    <Shortcut Id="startmenuManual" Directory="ProgramMenuDir" Name="Manual" LongName="Instruction Manual" />
                    <Shortcut Id="NewShortcut1" Name="NewShort" LongName="NewShortcut1" Target="[#FL_UsersGuide.pdf]" Directory="helpdocs" />
    

    So does anybody know how to make it so that you can have a file instead of a directory in the program menu shortcuts? I just know how to add directories to it, not files.


  • Registered Users Posts: 85 ✭✭slavigo


    Sorry man, I'll have to bow out.
    No problem if it was a core xml issue ( like processing or generating) but your looking more for help with the MSI xml structure, which is a little bit more specific and something I'm not familiar with at all. Any advice I'd give I'd just be google-ing for it first, so it's a little second hand.

    Good luck.


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Thanks.
    I would have thought there would be a wildcard search in general xml, but anyway, I'm dire t programming and don't know these things. :)


  • Advertisement
Advertisement