CodingWonders/DISMTools

"Program Exception" using alternative dism.exe

AnubyteCode opened this issue · 2 comments

What is the bug about?
Pointing to dism.exe 26100.1 pulled from the ADK, running on Windows 11 22631.3447.

How does it happen?
Clicking "View DISM component versions."

Expected behavior
To see components. I have every file and then some listed for my OS dism in one folder, with relevent .mui files in their respective en and en-us folders therein.

Screenshots
N/A

Additional context

_System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\ProgramData\DISM10\dism'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.Directory.GetFiles(String path)
   at Microsoft.VisualBasic.FileIO.FileSystem.FindPaths(FileOrDirectory FileOrDirectory, String directory, String wildCard)
   at Microsoft.VisualBasic.FileIO.FileSystem.FindFilesOrDirectories(FileOrDirectory FileOrDirectory, String directory, SearchOption searchType, String[] wildcards, Collection`1 Results)
   at Microsoft.VisualBasic.FileIO.FileSystem.FindFilesOrDirectories(FileOrDirectory FileOrDirectory, String directory, SearchOption searchType, String[] wildcards)
   at Microsoft.VisualBasic.MyServices.FileSystemProxy.GetFiles(String directory, SearchOption searchType, String[] wildcards)
   at DISMTools.DismComponents.DismComponents_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at DISMTools.Options.Button2_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Error Message: Could not find a part of the path 'C:\ProgramData\DISM10\dism'.

Error Code (HRESULT): -2147024893

Operating system information:
 - OS name: Microsoft Windows 11 Pro N for Workstations
 - OS version: 10.0.22631.3447
 - OS Platform: Win32NT
 - Is a 64-bit system? Yes_
Directory: C:\ProgramData\DISM10

Mode LastWriteTime Length Name


d---- 4/30/2024 3:54 PM en
d---- 4/30/2024 3:54 PM en-us
-a--- 4/1/2024 1:22 AM 406944 AppxAllUserStore.dll
-a--- 4/1/2024 1:22 AM 701856 AppxProvider.dll
-a--- 4/1/2024 1:22 AM 144696 AssocProvider.dll
-a--- 4/1/2024 1:22 AM 386352 CbmrProvider.dll
-a--- 4/1/2024 1:22 AM 1283376 CbsProvider.dll
-a--- 4/1/2024 8:41 PM 320832 cimfs.dll
-a--- 4/1/2024 8:41 PM 279872 cimfs.sys
-a--- 4/1/2024 8:41 PM 329272 Dism.exe
-a--- 4/1/2024 8:41 PM 27404 Dism.Format.ps1xml
-a--- 4/1/2024 8:41 PM 3318 Dism.psd1
-a--- 4/1/2024 8:41 PM 15380 Dism.psm1
-a--- 4/1/2024 8:41 PM 20378 Dism.Types.ps1xml
-a--- 4/1/2024 8:41 PM 1201720 DismApi.dll
-a--- 4/1/2024 1:22 AM 476464 DismCore.dll
-a--- 4/1/2024 1:22 AM 230704 DismCorePS.dll
-a--- 4/1/2024 1:22 AM 173376 DismHost.exe
-a--- 4/1/2024 1:22 AM 300352 DismProv.dll
-a--- 4/1/2024 1:22 AM 435504 DmiProvider.dll
-a--- 4/1/2024 1:22 AM 226608 EdgeProvider.dll
-a--- 4/1/2024 1:22 AM 701872 FfuProvider.dll
-a--- 4/1/2024 1:22 AM 95552 FolderProvider.dll
-a--- 4/1/2024 1:22 AM 185664 GenericProvider.dll
-a--- 4/1/2024 1:22 AM 91456 IBSProvider.dll
-a--- 4/1/2024 1:22 AM 247104 ImagingProvider.dll
-a--- 4/1/2024 1:22 AM 333120 IntlProvider.dll
-a--- 4/1/2024 1:22 AM 120240 LogProvider.dll
-a--- 4/1/2024 1:22 AM 146944 Microsoft.Dism.PowerShell.dll
-a--- 4/1/2024 1:22 AM 226624 MsiProvider.dll
-a--- 4/1/2024 1:22 AM 230704 OfflineSetupProvider.dll
-a--- 4/1/2024 8:41 PM 153128 oscdimg.exe
-a--- 4/1/2024 1:22 AM 185648 OSProvider.dll
-a--- 4/1/2024 8:41 PM 308664 PkgMgr.exe
-a--- 4/1/2024 1:22 AM 873792 ProvProvider.dll
-a--- 4/1/2024 1:22 AM 198064 SetupPlatformProvider.dll
-a--- 4/1/2024 8:41 PM 140856 siloedpackageprovider.dll
-a--- 4/1/2024 1:22 AM 349504 SmiProvider.dll
-a--- 4/1/2024 8:41 PM 165416 SSShim.dll
-a--- 4/1/2024 1:22 AM 808240 SysprepProvider.dll
-a--- 4/1/2024 1:22 AM 1500464 TransmogProvider.dll
-a--- 4/1/2024 1:22 AM 826792 ucrtbase_clr0400.dll
-a--- 4/1/2024 1:22 AM 641968 ucrtbase_enclave.dll
-a--- 4/1/2024 1:22 AM 1369088 ucrtbase.dll
-a--- 4/1/2024 1:22 AM 292160 UnattendProvider.dll
-a--- 4/1/2024 8:41 PM 8192 UnionFS.hiv
-a--- 4/1/2024 8:41 PM 492864 UnionFS.sys
-a--- 4/1/2024 8:41 PM 263488 UnionFSApi.dll
-a--- 4/1/2024 1:22 AM 599360 VhdProvider.dll
-a--- 4/1/2024 1:22 AM 283952 wdscore.dll
-a--- 4/1/2024 1:22 AM 2428 WimBootCompress.ini
-a--- 4/1/2024 8:41 PM 910888 wimgapi.dll
-a--- 4/1/2024 8:41 PM 8192 wimmount.hiv
-a--- 4/1/2024 8:41 PM 75056 wimmount.sys
-a--- 4/1/2024 8:41 PM 95552 WimMountAdkSetupAmd64.exe
-a--- 4/1/2024 1:22 AM 697648 WimProvider.dll
-a--- 4/1/2024 8:41 PM 648632 wimserv.exe
-a--- 4/1/2024 8:41 PM 8192 WofAdk.hiv
-a--- 4/1/2024 8:41 PM 271776 wofadk.sys

It's because the program has the DISM folder hardcoded. The workaround is to put all files, except DISM.exe and DismApi.dll, in a Dism folder. I'll add warnings related to that

I've added a warning when that situation happens, which is available in the latest nightly installer