I am working on a windows VSS application, I want some help regarding it.
After creating snapshot, how can I copy the files or files' blocks(sectors), preferably files' blocks, from volume snapshot using C/C++. Can someone guide me on this or can direct me to any samples or documentation doing the same.
Thanks in advance.
You can access VSS snapshot items using regular functions
CreateFile() to open a file
ReadFile() or BackupRead() to read/backup its data
Only the root path to the items will change
(for example, \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopyX\ instead of C:\ )
What do you want to know exactly?
Related
I'm writing an InnoSetup script to deploy software to a user's machine (default c:/programfiles) but I also want the user to be able to navigate to, say, a portable flash drive as well (like on a second page) and then have the installer load files to the HDD (programfiles) and then have it load files onto their selected flash drive - is this possible? How would I go about executing it?
thanks :)
I am not quite sure what you are trying to do but it sounds possible to me.
As you stated you could do this with a second page where you allow the user to select a drive or a directory where some files are.
You can then iterate over all files and install them into the selected program directory you chose in the setup before.
For more information it would be good if you could provide more information but so far this is the best answer i can give you for the provided information.
Maybe this helps you along when listing up all files in a directory:
Inno Setup: list all file names in an directory
And with this you can copy them:
Inno setup filecopy
And if you want a FolderBrowser use this:
Pascal Scripting: BrowseForFolder
I just want to be able to remove some specific files in my temporary internet files folder (for Internet Explorer), however I know that this is a special folder, and it doesn't seem to be straight-forward. Do I need to use the Shell object and reference WinINET? Was planning on doing this in C# or VB. Something simple. Any input is much appreciated.
Thanks
I would like to generate some temporary files in the course of my application. Specifically, I'm using AVAudioRecorder to record a file that I, upon stopping the recording, would like to load and edit/process. My question is:
What is the appropriate standard place to create temporary files. Is there some generally accepted approach to this for Mac or for iPad programming in general? I don't want to simply create a directory and write files into it if there is a proper protocol to this.
The answer to this question is actually a lot more complicated then one might assume. One cannot necessarily just use NSTemporaryDirectory and be done. I cocoadev.com has some good pages on this topic and I would suggest that you study them yourself and determine what will work best for your circumstance.
http://www.cocoadev.com/index.pl?NSTemporaryDirectory
http://www.cocoadev.com/index.pl?GettingTemporaryFolderOnSpecificVolume
The usual place for applications to store temporary data is /var/tmp. You could also use /tmp but this directory is for system-generated temporary files and anything in /tmp is deleted when the machine reboots.
What I found was that according to the iOS Application Programming Guide, I am supposed to query for the appropriate temporary folder for my application via NSTemporaryDirectory(). I tried this and it returned a folder within the /var directory, in my case '/var/folders/pQ/pQ+ZqZCSHWSIHftcbIo57U+++TI/-Tmp-/'.
/tmp or /usr/tmp are the usual places to store temporary files in Unix (which Mac OS X and iOS are).
I am trying to test out MVVMLight but the DLLs that come with it are BLOCKED. I have read about it and I am told to click the UNBLOCK in the file property.. but that doesnt exist for me.. Then I found out of a program called STREAMS that is suppose to unblock.. that didnt work... any other idea how to fix this?
Error 7
Could not load the assembly
file:///C:\MIX10-MVVM-Samples\Mix10.MvvmDemo2 -
End\Mix10.MvvmDemo2\Bin\Debug\GalaSoft.MvvmLight.Extras.SL4.dll
. This assembly may have been downloaded from the Web. If an assembly has been downloaded from the Web, it is flagged by Windows as being a Web file, even if it resides on the local computer. This may prevent it from being used in your project. You can change this designation by changing the file properties. Only unblock assemblies that you trust. See http://go.microsoft.com/fwlink/?LinkId=179545 for more information. Mix10.MvvmDemo2
The file contains an alternate data stream that indicates that the content was retrieved from the Internet and is not secure. This is a feature of the NTFS file system, one that's unfortunately well hidden because Explorer has no support for showing their content. You can see them from the command prompt with the DIR /R command option. And type their content with TYPE filename:streamname. And delete them with DELETE filename:streamname
Other tricks is to copy the file to a file system that doesn't support alternate data streams, that slices them off the file. A flash drive for example. Or a zip utility.
Later versions of Windows, I think starting with Win7, has built-in support for this in Explorer. Right-click the file, Properties and click "Unblock".
SysInternals has a great command line utility called Streams. This proved very useful for me.
Streams v1.56 - Enumerate alternate NTFS data streams Copyright (C) 1999-2007 Mark Russinovich Sysinternals - www.sysinternals.com
usage: streams [-s] [-d] <file or directory>
-s Recurse subdirectories
-d Delete streams
Execute the following command in the directory you wish to remove streams from (same effect as copying to USB/FAT32 drive)
streams.exe -d -s *.*
Unblock the zip file first, and then extract the dll's. Actually that's what they instruct to do here.
Only for general understanding. NTFS supports streams (see http://msdn.microsoft.com/en-us/library/aa364404%28VS.85%29.aspx). The full name of a stream is filename:stream_name:stream_type. So one can easy write some additional information about a file in an additional stream of file. If you download a file from the internet Internet Explorer write some simple information in a stream with the name Zone.Identifier. If you have a file test.dll downloaded from the internet you can use
more < test.dll:Zone.Identifier
to see information from the stream. You will see something like
[ZoneTransfer]
ZoneId=3
Unblocking is not much more as deleting of this stream. I recommend you to read http://weblogs.asp.net/dixin/archive/2009/03/14/understanding-the-internet-file-blocking-and-unblocking.aspx for more detaild information
I simply opened the dll file in notepad++ and saved it with a different name.
If it helps anyone, I pulled down two blocked DLLs from TFS.
My solution:
Inside of Windows Explorer, delete the two blocked DLLs.
Inside of TFS, do a 'Get Specific Version' operation on the folder, and make sure that 'Overwrite all files even if the local version matches the specified version' is checked so that you will pull down fresh copies of the deleted DLLs.
Rebuild your solution.
I want to apply NTFS-Search to our project.
Our project have to find the files which we specified.(fast and exactly!)
But I'm not sure the program(NTFS-Search) works well.
What if the specified file is system file?
What if the file is being opened by a process with NO_READ_SHARE_MODE?
Do you think NTFS-Search can find any files?
I don't know about NTFS filesystem well.
So I can't find the answer myself.
Is there anyone who knows that?
I tried to find their email address, but I couldn't find.
Thanks in advance.
According to the description of that project it just scans the MFT for a specified file name. This means that neither the file attributes nor its share flags for open files should make any difference.
You can contact the developer on their user page at sf.net, by the way.