I am currently working on an installer for my software using the WiX toolset. Today I faced the problem of getting only the name of an file. In the main file I include another .wxs file, which is generated automatically and defines the files of the application. In this main file I want to get the file name of a file referenced in the included file. I know, that
[#FILE-ID]
returns the full path to the file with the specific id, but how can I get only the file name?
Is there an similar opportunity or are there any substring operations in Wix? I did not find any solution in the internet yet and hope, you can help me.
Related
I am trying to reverse engineer a csv file, so that I would use it to create an ODi mapping to load data from file to table. While doing reverse engineering under Attributes tab, I face the below error -
java.net.MalformedURLException: no protocol: #PROJECT.DIRECTORY_PATH/#PROJECT.FILE_NAME
where #PROJECT.DIRECTORY_PATH is a project-specific variable to get the unix directory path where the file resides and PROJECT.FILE_NAME is a variable indicating the file name. Could anyone please help me find the cause of this error? TIA.
I tried validating the queries which I had used in the variable and they seem to fetch the correct results for the directory path and the file name.
try with the name of the file in clear. I think that you cannot use variables there!
I am using Visual Studio (2017) and I need the following.
I have a folder where a code generator puts the .h and .c files obtained from a formal model. This folder is not controlled by me, e.g. I cannot write in it, but it is updated by another team member.
By using the /I compiler options (or Additional include directories in the project properties) I managed to import all the generated header files in my VS project. What I am supposed to do is to integrate this generated code into a specific platform, this means that I have to compile both the generated code and the integration code on the target platform. The problem is, the compiler is not able to resolve the generated function definitions of the generated code as it only sees the .h files. What I got is a linking error (external symbol not resolved)
To solve the problem, I added the existing .c files manually, one by one. The obvious problems that comes with this solution are
manual boring work
when new files are generated, I need to manually import the new files
Question is: is there an option that can be set in order to specify the path of the source files without passing them one by one?
note: just copying and pasting the generated code in the VS project folder is not an acceptable solution.
Thanks
If you look at https://learn.microsoft.com/en-us/cpp/ide/working-with-project-properties?view=vs-2017 then you see there is a Source Directories property that has $(VC_SourcePath) as a default but (I think) to which you can add additional paths. The documentation is unclear whether that means all source files in such a path will be included for compilation.
At the bottom of the documentation it explains how to override certain project properties by providing an external properties file. It seems you can override the targets/sources using such a file. You can generate the file using a small tool that reads the filenames in those directories and adds them to the file.
You could also analyze the .vcproj file and build a small tool that wil re-write the part with your generated source directories, reading the filenames in those directories and adding them to the section in the .vcproj file.
I am trying to replicate one coding example in Visual Studio and I see that in a form there are some resx files.
I am trying to put a resx file into my form as well so I created a new resource file but as I try to move it on the form in solution explorer i get an error saying i cannot do that ("destination folder is the same as the origin")
I am new to Visual Basic so maybe I am missing something but where am I doing wrong?
Rename the copy of folder and files because two folders with same name can not exist at same place.
Copy file to outside anyway rename and again paste there.
I tried to list the files in my local directory as well as to read a file. But was not able to do it. Can any one give me sample code to get the list of files in a directory using gwt-filesystem.
It depends from where you are reading. You can't obviously read from the client due to security issues (any HTML wouldn't let you do that). However, you could obviously read the list of files in a folder from the server side.
I have some XML files marked as "Content" that should be copied into the application's XAP file. How can I read these files from within Silverlight?
I know how to read files normally in .NET. So what I'm looking for is a way to find where Windows stuck the files and any realavent security issues.
This is not exactly how to read files from within the xap but if you just want to be able to load the files at runtime then this will work.
You can set the files to be embedded resources. You then get access to them using the following:
GetType().Assembly.GetManifestResourceStream(resourceName)
resourceName is the name of the file with a full namespace. E.g. if your assembly default namespace (set in project settings) is "foo" and your file is in a folder called "bar" then resourceName would be something like "foo.bar.MyFile.xml"
You should just be able to do an XDocument.Load an pass in the name of your file.