- Reaction score
- 1,299
- Location
- Charente, France
Only the known libraries.Hey Fab, regarding libraries, does AutoBackup grab all libraries or only the 'known' libraries, Documents, Music, Pictures, Videos?
Only the known libraries.Hey Fab, regarding libraries, does AutoBackup grab all libraries or only the 'known' libraries, Documents, Music, Pictures, Videos?
I did not even know that was possible. That will be a pain to include this.
I think these things are worth doing. Put it on the list and give it some thought. There will be a bit code refactoring to accommodate many libraries and many paths within each library. The biggest pain will be refactoring the gui for many libraries.I did not even know that was possible. That will be a pain to include this
Indeed.I think these things are worth doing. Put it on the list and give it some thought. There will be a bit code refactoring to accommodate many libraries and many paths within each library. The biggest pain will be refactoring the gui for many libraries.
Not off the top of my head but I'll have a scout around. I found this discussion at MSDN:Indeed.
Do you know where the information about libraries is stored in registry? If so, that would save me some Google search time
Edit: This library feature looks like to be gone in Win8/10. So, this is impossible to transfer it from 7 to 10 right?
That's C++ code from MSDN. I think you're Delphi, yes? I found a discussion with Delphi code here: https://stackoverflow.com/questions/12485427/how-to-read-write-windows-7-library-locationsNot off the top of my head but I'll have a scout around. I found this discussion at MSDN:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd758096(v=vs.85).aspx
It could get messy:
"To access the contents of a library, you must use the Windows Shell API. Functions of the file-system API cannot be used to access library contents because libraries are not file-system objects. If your program uses a custom file browser that is based on the file-system API, it will not be able to browse libraries or access library content."
However it might not be so bad:
"The easiest way for a program to access library content is to use the Shell Library API. If you are working on a program that uses the file-system API, the Shell Library API can return the file-system folders of a library, which minimizes the change to your existing program code."
IShellLibrary *picturesLibrary;
hr = SHLoadLibraryFromKnownFolder(FOLDERID_PicturesLibrary,
STGM_READ,
IID_PPV_ARGS(&picturesLibrary));
// picturesLibrary now points to the user's picture library
IShellItemArray *pictureFolders;
hr = pslLibrary->GetFolders(LFF_FORCEFILESYSTEM, IID_PPV_ARGS(&pictureFolders));
// pictureFolders now contains an array of Shell items that
// represent the folders found in the user's pictures library
Hrmmm. I found that here. It matches what I see on the tree when there's only one path but when I add a path or change the "Save Location", it doesn't match up any more. It retains the old single path and not the changes. Curious. From what I read, the correct approach is the shell API as above.Today, the program uses the registry and get the paths at HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
Not sure that would follow when running a program with admin credentials while restoring to another user profileHrmmm. I found that here. It matches what I see on the tree when there's only one path but when I add a path or change the "Save Location", it doesn't match up any more. It retains the old single path and not the changes. Curious. From what I read, the correct approach is the shell API as above.
The libraries are still there in 1803 if that's what you mean?Edit: This library feature looks like to be gone in Win8/10. So, this is impossible to transfer it from 7 to 10 right?
Yeah, it's gunna be messy. To do it properly, you would have to be prepared to recreate the libraries and the multiple locations within those libraries when restoring to another user profile.Not sure that would follow when running a program with admin credentials while restoring to another user profile
This is my first concern here. If this cannot work offline, going further is uselessWhat I haven't yet discovered is how to use the Shell API to reference a user profile other than the "current" one.
Oh dear, I seem to have generated a lot of work for youI have started playing with the libray-ms files in the user profile. It looks like they can be transferred from a computer to another and modified using a simple text editor. That will still be a pain since I will have to parse the files, extract all the paths, checking if the extracted path is the default save path or not. Also, this will change a lot the way Fab's AutoBackup works : the registry detection routine will have to be tossed except for Windows XP computers. In fact, I will have to keep both "mechanisms" and try to not make a copy more than once.
It is worth it anyway
It looks like toOh dear, I seem to have generated a lot of work for you![]()
A question that just appeared somewhere in the cerebral cortex is this: I presume at the moment you back up files from the Library path found in the registry and restore to the Library path found in the registry. The paths don't have to be the same. It doesn't matter. However, in the scenario where the source Library has multiple paths, how would you handle the restore?It looks like to
In fact, there is no ideal scenario for restore. The less bad is first to attempt to restore to original path then create let's say a D subfolder in "My Music" folder if D is not writable. The problem would be that if the tech is using an external drive that has the D letter on the new system: the files will be restored straight to the tech's drive... Another pain to solve hereA question that just appeared somewhere in the cerebral cortex is this: I presume at the moment you back up files from the Library path found in the registry and restore to the Library path found in the registry. The paths don't have to be the same. It doesn't matter. However, in the scenario where the source Library has multiple paths, how would you handle the restore?
1) Would you attempt to recreate the paths and restore to multiple paths so that the original Library configuration is restored? What if the restore target system doesn't have a D: drive (or whatever), ie not possible to recreate a path?
2) Or maybe just restore everything to the new "Save Location"
3) Pop up option dialog, "User libraries have multiple paths. Do you want to recreate the paths or merge into one path?"
I know the idea of popups in the middle of a restore is contentious so maybe something like this. This will attempt to recreate the library paths but if that can't be done then the paths are merged.
rem restore library pseudo code
for each library
for each path in librarynext library
if the path is the old save pathnext path
change to new save pathelse
attempt to create the pathif path is writable
if creation fails
change path to new save path
restore files
I must agree with this one. Creating the same mess is probably not the best way to educate people on how to use their machine properly. If the second location is on the same drive then, I could keep the original path and add the it to the new library. If the drive is different, then create a sub folder in the usual folder restore the content here and adding a notification in the restore log. At least, the content will be restored to the customer's computer and not mixed with something else.Maybe, maybe not.
As with the long-running saga of locating data stored in non-standard places, this is enough of an edge case that it might not be worth providing a complete solution at all. It might be enough to identify the problem and then notify the technician that the libraries need to be created manually using the technician's best judgement of what the new computer should look like instead of blindly following the horrific mess on the original machine.
Most of us using Autobackup treat it as a tool to help with the heavy-lifting part of a data migration not as a substitute for our own abilities, and it's not a big deal for us to do some of this process by hand once in a while. I'd much prefer that to trusting a program to make the right decisions for me when the right decisions could be different for two identical situations.
agreed.I must agree with this one. Creating the same mess is probably not the best way to educate people on how to use their machine properly. If the second location is on the same drive then, I could keep the original path and add the it to the new library. If the drive is different, then create a sub folder in the usual folder restore the content here and adding a notification in the restore log. At least, the content will be restored to the customer's computer and not mixed with something else.