Overlapping file names in WIX - file

I am facing a strange problem. My application has 2 folders. They act as 2 features (They are independent modules). Both folders have a file log4j.xml with different configurations.
To create a installer I run heat and candle on both folders and then light them to create an MSI. After installation I see that log4j.xml is same in both the folders. The log4j.xml of the 1st folder is copied to both folders.
Is this an issue or am I doing something wrong ?

I have used three approaches to address this issue in the past:
My Preference:
Restructure the input area (if necessary using MSBuild Copy task or scripts) so that there is a single folder tree (which may reflect how you plan to have the files on the target system). The point of this is to call heat once on a folder tree which has the two sub folders. When there are files of the same name in different subfolders, heat automatically adjusts the related file/component ids.
Alternative:
It sounds like you are using -suid. Not using it will create unique ids.
Alternative #2:
Create a transform to rename the Ids related to one of the similar files.

Related

What is the most appropriate way to store files?

I am dealing with one problem, before starting developing, I decided to do some research.
So the problem is what would be the efficient solution when storing files?
I read about it, and some people was against storing files within database, as it will have negative impact on backups / restorations, it will add more processing time when reading database for large files and etc...
Good option would be to use S3 or any other cloud solution to store the files, but for this current customer cloud won't be good.
Another option would be to store files under file system. The concept is clear, but I try to understand what I need to understand before implementing that solution.
For example we need to consider how we structure directories, if we would store 100 000 files in one directory it can be come slow to open and etc. As well there is like maximum amount of files that can be stored in one directory.
Is there any 3rd party tools that helps to manage files in file system? that automatically partitions files and places them in directories?
I work with a software that have more than 10 million files in file system, how you will structure the folders depends, but what I did was:
Create a folder to each entity (Document, Image...)
Into each folder create a folder to each ID object with ID beign the name of the folder, and put their files inside, but this could vary.
Example to Person that have the ID 15:
ls /storage/Person/15/Image/
Will give me this 4 images that in the database I linked to person with the ID 15:
Output:
1.jpg
2.png
3.bmp
4.bmp
If you have a HUGE amount of elements, you cold separate each digit of an ID into a subfolder, that is: Person wih ID 16549 will have this path: /storage/Person/1/6/5/4/9/Image/
About limits of files in folder I suggest you to read this thread: https://stackoverflow.com/a/466596/12914069
About a 3rd party tool I don't know, but for sure you could build this logic into your code.
English isn't my first language, tell me if you didn't understand something.

Visual Studio 2017 Folders in Project

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).

Merge code from several folders

Good Morning,
I am working on legacy code. This legacy code consists of multiple projects (language C with NI LabWindows CVI) and was never manged in a source control System but only in on folders. Over time it got a little messy and copies of this folder were created and changes were made to all folders depending the project that was built.
The result is, that there are 5 folders each containing different codes bases for what once was the same code. Also many files were modified in all folders because they are used in several projects. Each project was only build from 1 of the 5 folder (so project A was only build in folder 1, project b in Folder 4 etc.). It is not only raw code, but also user interface files.
I hope that was clear so far.
My task is to merge all the code into one one codes base (as it started of originally). And I would like to get some suggestions.
Here is the plan:
1. create baseline version of one folder that is supposedly that one with the most changes.
2. create GIT repository to store the code and all changes
3. go through all folders and merge files into baseline version using file diff software. (Folder 1 is baseline, merge folder 2 to baseline, merge folder 3 to baseline etc.)
Do you have any comments on this plan? What is good? Bad? Are there tools I can use?
This seems like as good of a plan as any. You have a mess on your hands either way.
If there are many changes to the user interface panels, that could be a headache. The UIR files are binaries, which will make git merges and diffs useless.
Go into each project and under Options->Preferences select the box to save .UIR files as .TUI files and save the project. This will give you a text file output describing the user interface and allow you to use diff tools properly.
EDIT
When the User Interface is active, you can directly select Options->Save in Text Format to do this as a one-off.
Good Luck!
It might also be worthwhile to use the UI to Code converter under CVI's Tools menu to convert all your UIRs to code. This should make them more compatible with text-based source control (like the save in text format approach), but may also ease the process of merging UIs.

Create project specific files in Clearcase

I'm wondering if it is possible to create project-specific files in Clearcase. What I want to do is create files in one project, use Clearcase to source control the files, but I don't want those files to leave that porject because they don't have applicability in any other project.
For example:
I want to manage database changes in Clearcase. I plan on having 3 folders in each project (projects are created for each release of the software). The folders are "install", "update", and "backout". The install folder contains the scripts needed to build a database from scratch for the stream that I'm working in, let's say the stream is in project "13.03". The "update" and "backout" folders contain scripts needed to update and backout the changes to bring the database from 13.02 to 13.03, and vice versa.
In the 13.04 project, I'll have the same folder structure, but I don't want the contents of the "update" and "backout" folders in my 13.04 because I'll have other files that will bring the database from 13.03 to 13.04.
So what I'm looking to do is essentially create "project-specific" files/folders in Clearcase.
I'd gladly take any other recommendation for managing database changes in Clearcase. Keep in mind that the 13.03 and 13.04 (for example) baselines could be being developed at the same time.
It seems you are referring to the same project, with different versions (13.02, 13.03, ...).
If that is the case:
simply update your 3 folder according to the current version
put a baseline (if we are talking about ClearCase UCM) on the component representing your project
if evolutions needs to be done on any file of a specific version, make a child Stream called, for instance, "13.03", and update your "13.03" folders there. They will evolve in complete isolation in their own dedicated "13.03" branch.
If you have to create a new directory for each project version (which means you don't need a source control system at all, just a simple backup system), then you have no choice but to recreate each of those folders with their appropriate files in them, making new "add to source control".

Folder comparsion

I have two folders with sub folders. One folder is the base folder, and the other one is the local folder. In these folders and subfolders consist identical as well as non identical files.
I want compare these folders and report the result in some other file. This report must consist of:
List of all identical files
List of all modified files
List of any missing file or folder
List of all non identical file
Is there a tool, batch script or utility for this?
I have tried WinMerge, but it's not the solution.
BeyondCompare is what you're looking for. It will give you all those reports in a matter of clicks.
UPDATE
As a follow up to your comment, you can also use this approach, which is as free as in beer, and does everything via command line.
Install a tool called diff tools, and you'll be able to do something like:
diff.exe
On the command line.
Araxis Merge is very good for this. I comes in a 64 bit version as well.
I have to recommend Beyond Compare for this, it's an excellent folder and file comparison tool. You can integrate it into Visual Studio as well for the file comaprison for a much better merging experience as well.
You can use WinDiff, a graphical file-comparison program.

Resources