Migration from hard drive #118
Replies: 8 comments
-
I understand your issue. There is offline capability in USMT (https://learn.microsoft.com/en-us/windows/deployment/usmt/offline-migration-reference) but SuperGrate pulls user info from WMI and there isn't a way to enumerate user info from an offline copy of windows. I suppose we could use a different method like mounting the offline registry and listing it that way for this specific scenario. Thoughts? |
Beta Was this translation helpful? Give feedback.
-
For this offline scenario, we can disable the user selection function and only migrate all users.
Most people have only one user on their computer (except for system users).
----- 原始邮件 -----
发件人:Dylan Bickerstaff ***@***.***>
收件人:belowaverage-org/SuperGrate ***@***.***>
抄送人:靳灿奇 ***@***.***>, Author ***@***.***>
主题:Re: [belowaverage-org/SuperGrate] Migration from hard drive (Issue #109)
日期:2024年03月04日 10点48分
I understand your issue.
The sequence of events that would have worked is to have captured a user profile first on an external drive but copying SuperGrate.exe to an external drive and running a backup, then re-installing windows, then, once back in windows, running a restore.
There is offline capability in USMT (https://learn.microsoft.com/en-us/windows/deployment/usmt/offline-migration-reference) but SuperGrate pulls user info from WMI and there isn't a way to enumerate user info from an offline copy of windows. I suppose we could use a different method like mounting the offline registry and listing it that way for this specific scenario. Thoughts?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I spent about $35 to purchase a migration license for a commercial software called PCmover Professional, which is written in C # and has excellent functionality.
I can't wait to reverse it and see how it works with USMT.
Here is the download address for the installation package: https://dl.laplink.com/ml/pro
----- 原始邮件 -----
发件人:Dylan Bickerstaff ***@***.***>
收件人:belowaverage-org/SuperGrate ***@***.***>
抄送人:靳灿奇 ***@***.***>, Author ***@***.***>
主题:Re: [belowaverage-org/SuperGrate] Migration from hard drive (Issue #109)
日期:2024年03月04日 10点48分
I understand your issue.
The sequence of events that would have worked is to have captured a user profile first on an external drive but copying SuperGrate.exe to an external drive and running a backup, then re-installing windows, then, once back in windows, running a restore.
There is offline capability in USMT (https://learn.microsoft.com/en-us/windows/deployment/usmt/offline-migration-reference) but SuperGrate pulls user info from WMI and there isn't a way to enumerate user info from an offline copy of windows. I suppose we could use a different method like mounting the offline registry and listing it that way for this specific scenario. Thoughts?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I am considering using Python to generate XML files for USMT. I plan to implement the migration of applications. Then, I created a repository, wrote some code, then deleted it, and then wrote a bit more. I plan to scan the registry on the Windows system, application installation paths, and user data for applications, but I encountered a problem: applications don't have a unique and easily identifiable identifier that a program can recognize. I can't determine which registry item, application installation path, and user data belong to which application; they don't correspond, especially when they're mixed together. I thought about using full-name matching, but that would still result in some unmatched entries. Those entries might be randomly picked from the stuff used by a hundred applications, possibly an abbreviation or alias of an application, leading to a mismatch. Presenting such things to the user and asking them to decide whether to keep or discard them is too difficult. So, I came up with a bold idea. Actually, the initial idea was to scan all applications first and then scan the files or registry used by these applications until I realized that these two operations have a high degree of overlap. So, I changed it to scanning the registry and files used by applications first, and then distinguishing which application uses them. Then I encountered the aforementioned problem: application names are not standardized. So, the bold idea is to mix the registry and files together and let the user choose which ones to delete. The program will no longer categorize them. The program will just read them out, and the order in which they are output will be the same as the scanning order. It will no longer classify by application, leaving it to the user to visually identify which ones are not needed and then delete them. Everything not deleted will be retained. Just dump the registry and files onto the target computer. The registry includes environment variables, the Start menu, etc., and the files include application installation paths, user data, etc. Isn't this idea both interesting and absurd? The Windows registry is really too messy. I don't know which keys the program should read. Once successful, after generating the XML file, you only need to use USMT to migrate the contents of the Users folder, and then use the generated XML file to migrate the applications, and that's it. I’m here mainly to see if there has been any progress on your project. I reverse-engineered PCmover Professional and obtained its source code, but I couldn’t crack it. There’s just too much source code, and I couldn’t find anything useful. I’m not familiar with reverse engineering or C#; it’s written in C#. After modifying its DLL and recompiling it, it seems the hash check failed. How unfortunate. As for another software, izinstall, it’s probably entirely written in C++. There’s an annoying .dat file as large as 500MB that I can’t decrypt. I suspect there’s something good inside. So I had to use Python to do something. I also checked out the USMT GUI editor, and it turns out it’s also paid! In my opinion, USMT’s XML files cannot be used to migrate applications universally, because some applications generate different registry entries just based on the installation method. XML files can’t accommodate so many scenarios. So, the solution is to dynamically generate XML files. PCmover Professional’s codebase is really overloaded with stuff, and the interface is very outdated. For a supposed GUI program, it’s really old-fashioned. The pricing model is also weird. Their official website is still written in PHP, an outdated technology. Here’s its code: https://github.com/Deng-Xian-Sheng/PCmover Here’s my Python code: https://github.com/Deng-Xian-Sheng/USMT-Helper |
Beta Was this translation helpful? Give feedback.
-
Not sure if this info helps or not, but USMT is built into Windows for in-place upgrades. Next time you do a feature update or an in-place upgrade, open task manager and you will see USMT running. |
Beta Was this translation helpful? Give feedback.
-
Actually, USMT does not migrate Windows system files, right? So, Microsoft is likely only handling what they are familiar with, which means: they have USMT migrate Windows system files and Windows system registry, but they don't move any content related to third-party applications. However, Windows updates must be very complex, and it doesn't seem like they can be managed just with USMT. I spent several more hours and energy reverse-engineering PCmover Professional, and it still prompts:
It's really messy inside; it seems like there are many "traps" set up. This software has been in development since 2005. Maybe I should give up on cracking its license and instead look at how it implements application migration. I guess that's what the software designers intended, to show the code but not let me crack it. The code related to the license is very well-protected, but the specific migration logic is probably the kind of code that "no one likes to look at." But I do. If I find it, handing it over to OpenAI's GPT to help me refactor it with Python shouldn't be a problem. At the very least, its logic has been tested over a long period, and the specific design must be very interesting. I even think that Microsoft might have included some advanced technology in it, considering PCmover Professional's collaboration with Microsoft. |
Beta Was this translation helpful? Give feedback.
-
I found it quite easily (although it's just a part of it), and as you can see, it’s pretty much what I expected. public List<ApplicationData> GetApplications(int taskHandle, GetApplicationsParameters parameters)
{
int num = 0;
List<ApplicationData> list = new List<ApplicationData>();
ZipArchive zipArchive = null;
string archiveFileName = AppDomain.CurrentDomain.BaseDirectory + "AppProfiles\\AppProfiles.zip";
try
{
zipArchive = ZipFile.OpenRead(archiveFileName);
}
catch (Exception)
{
}
string name = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
OperatingSystem osversion = Environment.OSVersion;
using (RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(name))
{
foreach (string text in registryKey.GetSubKeyNames())
{
using (RegistryKey registryKey2 = registryKey.OpenSubKey(text))
{
try
{
object value = registryKey2.GetValue("DisplayName");
object value2 = registryKey2.GetValue("SystemComponent");
object value3 = registryKey2.GetValue("IsMinorUpgrade");
object value4 = registryKey2.GetValue("ParentDisplayName");
object value5 = registryKey2.GetValue("DisplayIcon");
object obj = (registryKey2.GetValue("EstimatedSize") == null) ? "0" : registryKey2.GetValue("EstimatedSize");
TransferSafety safety = TransferSafety.MediumLikely;
if (value != null && value2 == null && value3 == null && value4 == null)
{
if (zipArchive != null)
{
string fileToFind = text.ToString() + ".txt";
ZipArchiveEntry zipArchiveEntry = (from e in zipArchive.Entries
where string.Compare(e.FullName, fileToFind, true) == 0
select e).FirstOrDefault<ZipArchiveEntry>();
if (zipArchiveEntry == null)
{
fileToFind = "DB/" + text.ToString() + ".txt";
zipArchiveEntry = (from e in zipArchive.Entries
where string.Compare(e.FullName, fileToFind, true) == 0
select e).FirstOrDefault<ZipArchiveEntry>();
}
if (zipArchiveEntry != null)
{
using (Stream stream = zipArchiveEntry.Open())
{
if (stream != null)
{
string text2 = new StreamReader(stream).ReadToEnd();
int startIndex = text2.IndexOf(this.GetOsName(osversion));
int num2 = text2.IndexOf("OS :");
string text3 = (num2 == -1) ? text2.Substring(startIndex) : text2.Substring(startIndex, num2);
if (text3.Contains("CompatibleOs: Win10,W64"))
{
safety = TransferSafety.High;
}
if (text3.Contains("IncompatibleOs: Win10,W64"))
{
safety = TransferSafety.Low;
}
}
}
}
}
ulong appDiskSpace = 0UL;
ulong.TryParse(obj.ToString(), out appDiskSpace);
ApplicationData applicationData = new ApplicationData
{
Selected = true,
Name = value.ToString(),
Safety = safety,
IsModifiable = true,
AppId = Guid.NewGuid().ToString(),
IsDisplayable = true,
AppDiskSpace = appDiskSpace
};
if (num == 0)
{
applicationData.IsDisplayable = false;
}
if (num == 1)
{
applicationData.IsMatching = true;
}
Icon icon = SystemIcons.WinLogo;
if (value5 != null)
{
icon = Icon.ExtractAssociatedIcon(value5.ToString());
applicationData.Bitmap = icon.ToBitmap();
}
list.Add(applicationData);
num++;
}
}
catch (Exception)
{
}
}
}
}
return list;
} |
Beta Was this translation helpful? Give feedback.
-
I also found something interesting. Their product documentation is very well written. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
At present, I can only migrate through the network, but I did not purchase a new computer. Instead, I reinstalled the Windows system and the previous C drive is still there. I want to migrate the previous application to the current system.
Describe the solution you'd like
There is a button or option to select the path to the source system root directory, such as D:\
Describe alternatives you've considered
I will use the tool export to USMT command, and I will modify and execute it myself
It seems unlikely, but if you don't modify the application and still want to use it to help, this is the only way
The main issue is that USMT is not easy to get started with and learning is difficult.
If the hard drive cannot be used as the source, then those people can only bear the learning cost of USMT.
Additional context
no
other
What help can I provide? I am a programmer!
I feel that USMT is not easy to get started with, especially those XML files. I don't know what tools can generate them.
If manual editing is necessary, it can be troublesome, and Microsoft documentation does not provide tutorials similar to "Quick Start"
Beta Was this translation helpful? Give feedback.
All reactions