Application Deployment - deployment

I deployed an application using this method and it worked very good. However, there are 2 missing things that I been trying to find but can't:
1) How do I include resource files in the installation? I have a folder with files that have some user data, and those need to be there after the installation so the application can run, this is an oversimplified example I'm working on (I need to include NecessaryFile1.xml, NecessaryFile2.xml and NecessaryFile3.xml and the folder they're in):
alt text http://img193.imageshack.us/img193/7782/resources.png
2) How can I put the application in the start -> programs menu? It doesn't seem to do that either. It just puts it in the C:\Program Files\My Company Name\ApplicationName\ directory.
Thanks for any suggestion!

Go to your Setup project in Visual Studio. In the "File System" tab, locate "Application Folder". Right-click and then click Add | Folder. Name the new folder "Data". Right-click on the new "Data" folder and click Add File, then add the needed XML files. Repeat for as many different folders and/or files as required by your application.
When you compile and run your setup project, the "Data" folder and its contents will be deployed along with the application.

Click on each XML file in the Solution Explorer and then in the Properties window below (see your screenshot) you click and change "Build Action" to "Copy" and "Copy to Output Directory" to "Copy If Newer". That does the trick for me, at least with ClickOnce...

Related

File manager for eclipse

Often i need compare or edit some files, which are not in the project. For example from the removable drive. I like to work with any files in eclipse(so much power!). But to see files, they must be in any project.
I try to place files into some project - it's not comfortable. I need to open file manager and copy files into existing project or create new project in eclipse.
I try create project with "d:\" location, but it overlaps my existing projects and eclipse can't create such project.
I search through plugins and install EclipseCommander - it's not what i want, because there is no "compare with" in context menu, it have popup, it overrides my controls(when commander view is open(but not in focus) and i press f5 in package explorer, eclipse try to invoke "copy" :) ), etc.
Best if i can browse all my computer's files in tree-like view, like "package explorer", "navigator" or "project explorer".
Till now best what i find is to create project with "e:\" location. But it creates project on e:\ and still not solve problem with files on d:\ .
So how to browse all local files in eclipse?
You'll have to create projects, or I recommend instead, folders for each drive. It's a Windows limitation/design that every drive has a separate volume and there's no real root to everything on the system.

How to place a file on classpath in Eclipse?

As this documentation says, "For example if you place this jndi.properties file on your classpath", but how can I place the .properties file on my classpath if I am using Eclipse?
Just to add. If you right-click on an eclipse project and select Properties, select the Java Build Path link on the left. Then select the Source Tab. You'll see a list of all the java source folders. You can even add your own. By default the {project}/src folder is the classpath folder.
One option is to place your properties file in the src/ directory of your project. This will copy it to the "classes" (along with your .class files) at build time. I often do this for web projects.
This might not be the most useful answer, more of an addendum, but the above answer (from greenkode) confused me for all of 10 seconds.
"Add Folder" only lets you see folders that are the sub-folders of the project whose build path you are looking at.
The "Link Source" button in the above image would be called "Add External Folder" in an ideal world.
I had to make a properties file that is to be shared between multiple projects, and by keeping the properties file in an external folder, I am able to have only one, instead of having a copy in each project.
Well one of the option is to goto your workspace, your project folder, then bin copy and paste the log4j properites file.
it would be better to paste the file also in source folder.
Now you may want to know from where to get this file, download smslib, then extract it, then smslib->misc->log4j sample configuration -> log4j here you go.
This what helped,me so just wanted to know.
Copy the file into your src folder. Go to the Project Explorer in Eclipse, Right-click on your project, and click on "Refresh". The file should appear on the Project Explorer pane as well.

Is there an equivalent of "Add existing file" (to project) in Eclipse?

I am trying to map my Visual Studio experience onto Eclipse. Right now, I wish to add a file existing somewhere on the file system into a project in Eclipse. I expect it to be copied to the project source folder.
Currently, I see only one way - switch to the windows explorer (total commander, in my case) and copy the file myself, after which to refresh the project.
Can I do the same without leaving the Eclipse IDE?
Thanks.
I had the same problem, but found yet another solution.
Let me state my problem so that we're sure we're talking about the same thing.
I had a file in a directory where a bunch of code files were and some of the files in that directory were shown as "in my project" and some of the files were missing. I wanted the missing files to appear in my project.
I simply selected the folder in my project and pressed 'F5' or right-clicked and selected 'refresh' and the files appeared in my project. It looks like that is the intended way of doing this.
File->Import->General->File System should do it.
There you can select the file(s) from some file system folder to your project (into folder).
Even easier. Just drag and drop the file from explorer into the correct package in Eclipse. It will ask you if you want to copy or link the file(s).
I am a newbie to Eclipse Luna (the 64 bit latest version on Windows 7) but this worked for me:
Copy the preexisting source files you which add to your project.
In Project Explorer, right click your project and select New > File
In the "New File" dialog box, your project's name / folder should be displayed as the parent folder for your new (existing) source file.
Click on the "Advanced" button at the bottom of the "New File" dialog box.
Check the "Link to file in the file system" checkbox.
Click the "Browse" and browse to your preexisting source.
Click the "Finish" button at the bottom of the dialog box.
In my case, I had to:
right-click the project's name
choose "Close Project"
right-click the (now closed) project's name again
choose "Open Project"
Refreshing didn't work for me. :(
Hopefully this helps someone else...
Just found the quickest way to add files:
Copy-paste your file into your project disk directory using your file browser.
In Eclipse project browser select your project.
Click [right mouse button]->Refresh (or press F5 on Windows machine).
Voila
(worked on Neon-4.6.2)
I just got this to work. YMMV
I don't suppose it has to be there, but I put my file, xyz.cpp, into my project's source directory. My project has a source subdir named src, as in ProjName/src.
Right Click on project name (my project was open and the only one open).
NEW->FILE. Put in the filename, xyz.cpp. Click OK or press enter.
The file will open in the editor and complain that it is empty. Close it WITHOUT SAVING.
Reopen the file. It now has its contents.
It turns out that just simply dragging the files into the src folder would work!
Right-click on the file after you have copied it into the project directory. Select Properties... in the left hand pane select C/C++ Build. There will be a checkbox "Exclude resource from build" uncheck that check box.

Aptana/Eclipse: How do I make a project that uses existing files on my filesystem, instead of copying?

I want to create a project that uses source files already on my filesystem, but the IDE always wants to create a directory and make a second copy of all the source.
This has always annoyed me about Aptana and Eclipse, is there a workaround for this?
I am using Aptana Studio 3 on my mac and the way I do it is:
Click on File
Select Import from the dropdown menu
Select the General tab and open it, you will see the option Existing Folder as New Project
Select it and click on Next
On the next page select the folder where you have the old project files, name the new project(if you want to change it). You can also select the languages that you have used on the project.
Click Finish and you are set to go.
One small addendum, the existing folder doesn't actually need to be in your workspace. I have several projects in my workspace but also several located elsewhere for assorted reasons.
have the files in a directory under your workspace
use "create project" and change the default folder to the one created above.
I too wasn't aware of how to do this..
But i tried this way and it worked..
Step 1: Try to create new workspace with the name and location as you wish
Step 2: click new->Java Project
Step3: In the create a Java Project Window select the option for Creating from existing Resource" and select the resource you want
Step4: You can see the project name as automatically set by itself based on the folder containing the project that you select.
Step5: click finish
Step 6: I guess, you need to open Navigator view(Window->show view-> navigator) for best viewing
Hope this works gud.. Post here if its not working,..
There is a checkbox named "Prompt for workspace on startup". It's in Window -> Preferences -> General -> Startup and Shutdown -> Workspaces. If you check this, on next Aptana startup you will be prompted to define a new Default workspace directory which would be your default projects folder.
There is also another way to do that.
Create an empty project (right-click in the Project Window and go to "New->Project" and then "General->Project" and click "Next", after that type in a project name and click "Finish").
Add a new connection to this project (right-click on "Connections" and then "Add New Connection"). The "Source" should be your project and the "Destination" should be the type "Filesystem" with a folder of your choice.
Finished.
I only use that method in very rare cases, as example, if u need a simple file-reference of any folder on your harddrive or if you need an overall file-reference to your workspace folder which contains all project folders, etc..
This answer by no means solves the issue above in Aptana but if you are in a rush, try using FreeCommander http://www.freecommander.com. It is a dual pane file manager with a slew of options. I have been using it for almost 3 years and there is never a day I don't use it.
What I did for now, is I allowed Aptana to create a folder in the workspace at the same level as the original folder I would like to use. Using FreeCommander I then have the original (src) folder in one pane with the new folder (dst) in the other pane.
I then manually copy (F5) or use FreeCommander's built in sync function (Alt + s) so that both folders have the same contents at all times.
Again, not the right answer but a workaround as work needs to be done. Cheers.

Eclipse - Ignore Entire Directories

I use Aptana Studio (based on Eclipse). I'm trying to get Eclipse to completely ignore an entire directory inside a project. I mean COMPLETELY. I don't want it to display in the project folder. I don't want Eclipse to even be aware it exists.
Unfortunately, all my efforts to add it as a filter don't work. See http://forums.aptana.com/viewtopic.php?f=14&t=8340#p33714 . I think the filter only prevents the folder from being displayed in the project display. It doesn't keep Eclipse from actually looking at all the files in that folder for code assist, etc.
My problem is that directory has thousands of text files. So, each time Eclipse opens or refreshes this project, it analyzes all those files.
How can I prevent this?
Not sure about this aptana thing, but there is a convenient way to do it in native eclipse:
Right-click a project folder in Project Explorer tree and go to "Properties".
Resource -> Resource Filters.
Add as much exclusion filters for files/folders as you like.
If your project tree is not refreshed immediately, press F5 to enforce it.
Consider also the 'Derived' checkbox: right-click an entry in the package explorer, choose properties, check Derived. This may solve part of your problem.
See http://robmayhew.com/eclipse-ignore-folder/
If you have a linked resource (pointing off to some other file/folder on disk) with the same name in the same location in the resource tree, then the real folder on disk will be hidden from the resource model.
Unfortunately you can't create the linked resource if the real directory is already there in the project structure. You can try something like this:
On disk, rename/move the directory in question
Refresh the project, the directory is gone
Create a linked resource ( New -> File/Folder >> Advanced -> Link to file in the file system ). Name it the same as the original directory.
On disk, restore the original name of the directory
Refresh project.
Try right-clicking "Properties" and unchecking all permissions.