Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MicroWin can't open the image #2863

Closed
ivaf opened this issue Oct 2, 2024 · 14 comments
Closed

MicroWin can't open the image #2863

ivaf opened this issue Oct 2, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@ivaf
Copy link

ivaf commented Oct 2, 2024

Describe

When I try to upload a Windows image to MicroWin, I get an error message: "Neither install.wim nor install.esd exist in the image, this could happen if you use unofficial Windows images. Please don't use shady images from the internet, use only official images. Here are instructions how to download ISO images if the Microsoft website is not showing the link to download and ISO".
The image was downloaded correctly, the necessary files are there.

Terminal output:

oscdimg.exe on system: True                                                                                             File path C:\Temp\Win11_24H2_Russian_x64.iso                                                                            You have enough space for this operation.                                                                                                                                                                                                        Copy Windows files                                                                                                         Copy files 5 on 1158: autorun.inf                                                                                       [                                                                                                            ]                                                                                                                              Done setting up mount dir and scratch dirs
Scratch dir is C:\Temp\Scrach
Image dir is C:\Temp\micro
Copying Windows image. This will take awhile, please don't use UI or cancel this step!
Copy 1158(s) from F: to C:\Temp\micro
ПРЕДУПРЕЖДЕНИЕ: Unable to Copy all the files due to unhandled exception
ПРЕДУПРЕЖДЕНИЕ:    в System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   в System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   в System.IO.FileInfo.CopyTo(String destFileName, Boolean overwrite)
   в Microsoft.PowerShell.Commands.FileSystemProvider.CopyFileInfoItem(FileInfo file, String destinationPath, Boolean
force, PowerShell ps)
   в Microsoft.PowerShell.Commands.FileSystemProvider.CopyItemLocalOrToSession(String path, String destinationPath,
Boolean recurse, Boolean Force, PowerShell ps)
   в Microsoft.PowerShell.Commands.FileSystemProvider.CopyItem(String path, String destinationPath, Boolean recurse)
   в System.Management.Automation.SessionStateInternal.CopyItem(CmdletProvider providerInstance, String path, String
copyPath, Boolean recurse, CmdletProviderContext context)
Copy complete! Total Time: 0m0s
Getting image information C:\Temp\micro\sources\install.wim
Neither install.wim nor install.esd exist in the image, this could happen if you use unofficial Windows images. Please don't use shady images from the internet, use only official images. Here are instructions how to download ISO images if the Microsoft website is not showing the link to download and ISO. https://www.techrepublic.com/article/how-to-download-a-windows-10-iso-file-without-using-the-media-creation-tool/

Screenshots:

image
image

Additional context

I tried to do it on two computers. I got this result everywhere.
OS: Windows 10 Pro x64 22H2 (19045.4894)
Locale RU

@ivaf ivaf added the bug Something isn't working label Oct 2, 2024
@FusselTV
Copy link

FusselTV commented Oct 2, 2024

same

@CodingWonders
Copy link
Contributor

@ivaf, @FusselTV, can you try running the changes from my fork in #2853? This is the stack trace: nothing useful.

NOTE: you will have to build the script by running compile.ps1 in either PowerShell 5 or 7

@ivaf
Copy link
Author

ivaf commented Oct 2, 2024

try running the changes from my fork in #2853?

I tried it. Here is such a mistake:

PS D:\user\Documents\GitHub\winutil> .\compile.ps1
ConvertFrom-Json : Недопустимый примитив JSON: .
D:\user\Documents\GitHub\winutil\Compile.ps1:77 знак:29
+     $jsonAsObject = $json | ConvertFrom-Json
+                             ~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

@CodingWonders
Copy link
Contributor

CodingWonders commented Oct 2, 2024

@ivaf, perhaps run the script in PowerShell 7 (or PowerShell 5 depending on what you used there)

@ivaf
Copy link
Author

ivaf commented Oct 2, 2024

@ivaf, perhaps run the script in PowerShell 7 (or PowerShell 5 depending on what you used there)

PSVersion 5.1.19041.4894

Now I have installed PowerShell version 7.4.5
I run compile.ps1, then winutil.ps1
Copying the Windows image failed again:

oscdimg.exe on system: True
File path C:\Temp\Win11_24H2_Russian_x64.iso
You have enough space for this operation.
Mounting Iso. Please wait.
Done mounting Iso MSFT_DiskImage (ImagePath = "C:\Temp\Win11_24H2_Russian_x64.iso", StorageType = 1)
Iso mounted to 'F'
Setting up mount dir and scratch dirs
Mounting Iso. Please wait.
Done setting up mount dir and scratch dirs
Scratch dir is C:\Temp\Scrach
Image dir is C:\Temp\micro
Copying Windows image. This will take awhile, please don't use UI or cancel this step!
Copy 1158(s) from F: to C:\Temp\micro
WARNING: Unable to Copy all the files due to unhandled exception
WARNING:    at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
   at System.IO.FileInfo.CopyTo(String destFileName, Boolean overwrite)
   at Microsoft.PowerShell.Commands.FileSystemProvider.CopyFileInfoItem(FileInfo file, String destinationPath, Boolean force, PowerShell ps)
   at Microsoft.PowerShell.Commands.FileSystemProvider.CopyItemLocalOrToSession(String path, String destinationPath, Boolean recurse, Boolean Force, PowerShell ps)
   at Microsoft.PowerShell.Commands.FileSystemProvider.CopyItem(String path, String destinationPath, Boolean recurse)
   at System.Management.Automation.SessionStateInternal.CopyItem(CmdletProvider providerInstance, String path, String copyPath, Boolean recurse, CmdletProviderContext context)
Copy complete! Total Time: 0m0s
Getting image information C:\Temp\micro\sources\install.wim
Neither install.wim nor install.esd exist in the image, this could happen if you use unofficial Windows images. Please don't use shady images from the internet, use only official images. Here are instructions how to download ISO images if the Microsoft website is not showing the link to download and ISO. https://www.techrepublic.com/article/how-to-download-a-windows-10-iso-file-without-using-the-media-creation-tool/
Dismounting bad image...
Done reading and unpacking ISO

@CodingWonders

This comment was marked as outdated.

@CodingWonders
Copy link
Contributor

CodingWonders commented Oct 2, 2024

@ivaf, try running my changes again from my fork. They should feature better error handling

@ivaf
Copy link
Author

ivaf commented Oct 3, 2024

@CodingWonders, yes, I tried to run it from your fork. The error is the same.
Check me out - maybe I did something wrong:

  • downloaded your WinUtil fork here;
  • run compile.ps1;
  • run winutil.ps1;
  • tried to open the ISO image (in MicroWin tab), got the same error.

@CodingWonders
Copy link
Contributor

@ivaf, please provide the output of your process. Compilation is a bit broken on PowerShell 5 (it's been reported and a fix is on its way), so you need to compile it in PowerShell 7

@ivaf
Copy link
Author

ivaf commented Oct 3, 2024

@CodingWonders, I compile it in PowerShell 7. Attaching the log file.
PowerShell_transcript.SYSADMIN_NEW.ZisBjB_w.20241003121635.txt
If there is any other information about the output process, please tell me where to find it.

@CodingWonders
Copy link
Contributor

CodingWonders commented Oct 3, 2024

@ivaf, unfortunately, I can't help you because the exception information doesn't show the message. You'll have to do the following in the following order:

  1. Set a breakpoint on line 120 of winutil.ps1 by running Set-PSBreakpoint winutil.ps1 120
  2. Run the script in the PowerShell session and do the same steps as normal
  3. It should stop into the debugger, as it's hit the breakpoint. Type l to verify where you are in the script
  4. Type $_.Exception.Message or $PSItem.Exception.Message

Come back with the results. Or make sure you're pulling the changes from the microwin-1st-anniversary-prep branch if you don't want to do this

@ivaf
Copy link
Author

ivaf commented Oct 3, 2024

@CodingWonders Thanks for telling me about brunch! Here I finally saw what the problem was. Antivirus software. My antivirus did not allow access to the autorun.inf file, and at this stage the file copying was interrupted.
Solution: disable real-time file protection in the antivirus while the script is running.
Thank you very much for the answers!

@CodingWonders
Copy link
Contributor

@ivaf, I'm curious. What AV are you using?

@ivaf
Copy link
Author

ivaf commented Oct 3, 2024

@CodingWonders DrWEB Security Space. He really dislikes autorun.inf files :)

@ivaf ivaf closed this as completed Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants