views:

285

answers:

4

I have a standard c# application that acts as a GUI front end for a an "R" statistics engine. "R" consists of approx 600 files in approx 50 different folders and can be "installed" on a machine through xcopy deployment.

I would like to package up both the R engine and my c# gui into one setup.exe so that the user doesn't need to go and install R first and then my c# application seperately.

I know that I can produce a setup project and then add in the R files one by one but adding all 600 files will be very tedious!

Is there an easier way of doing what I want? Can I add the single R folder and automatically add the subfolders and files to save me adding them in one by one? Or maybe do an unzip procedure in my setup project which will unzip the R engine in one go?

+1  A: 

Have a look at the project file. I believe is text based. You might be able to insert the file paths directly there with some copy-paste-replace.

Aleris
+1  A: 

I couldn't work out the project file so what I did in the end was to zip up all the files I wanted to deploy, add the zip file to the application and create a custom Installer class to unzip them (using CSharp ziplib)

Calanus
+1  A: 

You can simply drag/drop the folder in Windows Explorer into the File System view of your Installer vdproj. All the files and folders in the hierarchy will be added to your setup project.

Tip: If the folders are in SVN or similar source control, delete all the hidden folders before you do this! If you have PowerShell, check out

get-childitem . -include _svn -force -recurse | foreach ($_) {remove-item -recurse -force $_.fullname}

Or you can always use Windows Search to find all hidden directories in the hierarchy and delete them from the Results Window.

Coxy
A: 

One thing you could try is adding the R files as content in the C# project - then the setup project can just copy them over for you (make sure you configure the setup file to copy content files from your project, not just the primary output).

You can either add the R folders into the project manually, or set up a script to modify the .csproj file (it's just an XML file) - content items are represented by these nodes:

<Content Include="myfile" /> 
Badjer