I building an installer with visual studio. To include my files I use Heatdirectory in the wixproj-file.
Heat is including all the files (including the hidden files).
That's what I want.
But: When files get copied to the target-system all of them are marked as visible. Is there any option to keep their state? I could not find anything.
greez
You can set the hidden attribute for a file when its copied by the installer. This makes the file hidden. Take a look at:
http://wixtoolset.org/documentation/manual/v3/xsd/wix/file.html (Look at the attribute Hidden)
However, I do not see an easy way to set this attribute on a file element when the file is being harvested. The only way I know of is to transform the generated output from heat as described at:
http://codedmi.com/questions/1552266/how-to-systematically-set-readonly-attribute-to-files-harvested-using-heat
Because I could not find a direct way to archive my goal I created an Custom Action and a (Pre-Build-)C#-Program.
Before building the Installer I search for hidden files and folders and create lists for them with a C#-Program.
After the files have been installed a custom actions marks these files and folders as hidden.
Related
I am using Visual Studio 2017 to write some stuff in C. When I open a new project, I have some default filters and in "add" option for the project there's only filter and no folder/directory.
I want my project to have a folder structure, but can't add folders to the project in Visual Studio. Looking online I can only find solutions for adding an existing folder to a project and not adding a new one.
How can I add new folders to a Visual Studio C project?
How can I disable filters?
The way that I think of Visual Studio 2017 (earlier versions of the IDE as well) and its presentation of files in File View is as a kind of virtual file organizing system. File View allows you to logically organize files, presenting the actual file system in a more helpful manner.
The icons that look like folders in the File View are not really folders but are instead labels, called filters, which allow you to group your files however you like regardless of how they are physically stored in your persistent storage area such as a hard drive.
Filters are more flexible by not corresponding to the physical file folder hierarchy as they allow you to organize files that are all in a single folder into logical groups. Filters allow this to be done at a finer grain than is typically used by grouping files in folders. Filters also allow you to group files that are in multiple folders together into a single logical folder within File View.
However filters can be confusing because most of us are so accustomed to file folder hierarchies that the filter methodology can disconnect the logical file as represented in a Filter from the physical file location located in a folder.
My typical methods of adding files
Typically what I do is to create the physical folders through Windows or doing a clone of an existing Git or Subversion or VS Team Services source tree. With something new I may use the New Solution or New Project wizard to create my initial starting point and then organize and add files and folders physically through Windows and then go into the Visual Studio IDE to create the Filters and then Add existing files to the Filters. In some cases I will create sub-filters within a Filter in order to better organize the files within a physical Folder.
For new files I will just use the Add New Item menu option to add the item to the proper project. If you right click on a filter name, the new file will automatically be added to the filter. In some cases when I have added additional filters to the project to organize files, I will drag the newly created item to the proper filter and drop it there.
This drag and drop is not changing the physical location of the file but is changing its logical position by moving it from one filter to another. To move the file physically from one folder to another, I will usually do that with Windows. Just remember that if you do physically move a file with Windows you must also modify the file's entry in the Visual Studio 2017 filter to which it has been assigned, I usually do a Remove on the file followed by Add Existing Item and browse to its new location.
It appears you can not have the same file in multiple filters within the same project.
In some cases when I Add New item, I will change from the suggested folder displayed in the Add New Item dialog to a different folder using the Browse button. And if I need a different extension to the file then I will make that change as well, a common action when adding a new C source file to a project which requires changing the .cpp extension to .c.
You can also use the Browse button to navigate to a folder where you can then create a new folder if you like using the right click menu that displays when you do a right click in the displayed list of files and folders.
Unfortunately, the Add New Item dialog always wants to put a file into the project directory with all the other files. The Add Class wizard doesn't give you the opportunity to specify anything other than the default project folder. I have in some cases created C++ classes using the Visual Studio IDE, removed them from the project, moved the physical files to where I want them to be and then added them back to the project.
The filter approach seems to work well because the total solution is divided up into multiple projects and each project has its own physical folder. The multiple projects may correspond to particular DLLs or static libraries or other components that are used by the solution.
See also Can I configure Visual Studio to use real folders instead of filters in C++ projects?
Example screenshots of folder and filters
Here is a Windows folder view of a small project of the resources being used:
And this is how I have the filters set up. Normally the list of resource files can be quite long however I have created two sub-filters to logically separate out bitmap files from icon files though they both share the same physical resource folder.
Also the filter named PepIncludes corresponds with an actual physical folder named the same while the filters named "Header Files" and "Source Files" are groups of files that all reside in the same physical folder which is named the same as the project folder.
The following screen shot shows how filters can provide flexibility. I have a folder with include files, PepIncludes, and I have the same collection of files in two different projects within this Visual Studio 2017 solution. In a solution with 30 or 40 projects, this can make it a lot easier to manage files. For instance you can see that after modifying the file "ECR.h" the fact that it has been modified shows in both of the filter file listings (the small red check mark next to the name).
So I have a word template that I am trying to populate within my wpf application. It works fine during development. However, when I try to edit the file after publishing/installing the application it no longer has the folder/files that were used in the development process.
What steps do I need to take to have files present after installation to manipulate, create, or delete files?
Right-click the file in VS Solution Explorer, then in file properties set Copy To Output Directory to Copy Always
Add that template as content in your solutions. You will find this from properties.
We're using JDeveloper at work and we are using a library that contains 15000 files inside its parent folder (ExtJS). Every time we want to look for something via the search->find in files it goes on and searches through the whole project including that library. How can I remove that folder from the search items?
Check the working-set feature to see if it helps - https://blogs.oracle.com/jheadstart/entry/jdeveloper_11g_working_sets_ho
I am searching for a possibility to exclude some files of my generated VS project file from TFS. I know that it is possibly afterwards with the .vspscc file.
But what i want is, that i can tell the VS project file, that some of it's files are not allowed to get added to TFS, before I add the project to TFS.
There are several levels of excluding files in TFS:
Manually by excluding a file or folder on the check-in dialog.
Manually by excluding a file or folder on the Add items to Folder dialog.
On the Add items to Folder dialog > Automatically exclude from source control:
Note: the default items can be modified using the registry.
On the team project source control level using a check-in policy.
On the source control permissions level:
Source Control > Mark a folder > Security > Deny Check-In permission
On the workspace level by cloaking.
Not sure about the accepted answer by KMoraz. #1 and #2 don't seem to be permanent, #3 doesn't even appear for me (I'm using VS2012), #4 and #5 require permissions (which I don't have on CodePlex) and #6 is not even relevant (because you cannot cloak something that isn't first checked-in).
I know your question is about BEFORE they are added, but I think the answer, which is to create a ".tfignore" file, only works for TFS 2012.
For me I had to locate the ".vspscc" file (which I know you already stated) in the project folder and look for this line:
"NUMBER_OF_EXCLUDED_FILES" = "0"
In my case I wanted to exclude TypeScript generated files, so I added this:
"NUMBER_OF_EXCLUDED_FILES" = "3"
"EXCLUDED_FILE0" = "app.js"
"EXCLUDED_FILE1" = "app.js.map"
"EXCLUDED_FILE2" = "app.min.js"
I really hope they get their head on straight and add the feature you're looking for to VS in a more accessible way.
... and yes, there's a menu for excluding files in "File->Source Control->Advanced", but it should be in a context menu, and it doesn't apply to NESTED files (such as the app.* ones above [for .ts files]).
I'm putting together a simple help system for my WPF app using XAML FlowDcouments (just .xaml files, no code-behind). I've simply added them to my project with Build Action = Resource, and I can load and display them as required.
Now, I'm trying to make it a bit more flexible, in that after the installation of the app, I want the user to be able to download additional (or newer versions of the existing) FlowDocument XAML help files. Given this, I'm now wondering where the best place to store these files is. A few questions/ideas:
Can I leave them as resource files, and overwrite or add new files as required? I can't find a example of how to add/edit resources at runtime on SO/Google. Is it even possible?
If not, is there a recommended location to store these files? They should be available to all users, so they can't go into the User's directory - they would have to go in the program directory. Does the program directory have write-access (I remember having issues with that before)?
Any other ideas?
Thanks.
The resource files are embedded into the executable and therefore you cannot change them.
As for a common place to put your downloaded help files, you cannot store them in "Program Files" since you would need admin privileges to write there.
I suggest you put them into SpecialFolder.CommonApplicationData (see http://msdn.microsoft.com/en-us/library/system.environment.specialfolder(v=vs.80).aspx), which is defined as "The directory that serves as a common repository for application-specific data that is used by all users."