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

ISO download window does not open when mapped drives from the search path are not available #2315

Closed
Tom-EllisEVENTS opened this issue Aug 31, 2023 · 3 comments

Comments

@Tom-EllisEVENTS
Copy link

Tom-EllisEVENTS commented Aug 31, 2023

This is a followup to closed issue #2030

Apparently, the fix from this commit does not work anymore, because the "-IgnoreWarnings" parameter that has been added got lost with commit 1d88dea.

Using WarningAction = "Ignore" seems not to be equivalent to using -IgnoreWarnings

After adding the following line right after "WarningAction", it works again:

IgnoreWarnings = $true

Full context:

$Signature = @{
	Namespace            = "WinAPI"
	Name                 = "Utils"
	Language             = "CSharp"
	UsingNamespace       = "System.Runtime", "System.IO", "System.Text", "System.Drawing", "System.Globalization"
	ReferencedAssemblies = $Drawing_Assembly
	ErrorAction          = "Stop"
	WarningAction        = "Ignore"
	IgnoreWarnings       = $true
	MemberDefinition     = @"
		[DllImport("shell32.dll", CharSet = CharSet.Auto, SetLastError = true, BestFitMapping = false, ThrowOnUnmappableChar = true)]
		internal static extern int ExtractIconEx(string sFile, int iIndex, out IntPtr piLargeVersion, out IntPtr piSmallVersion, int amountIcons);

		[DllImport("user32.dll")]
		public static extern bool ShowWindow(IntPtr handle, int state);
		// Extract an icon from a DLL
		public static Icon ExtractIcon(string file, int number, bool largeIcon) {
			IntPtr large, small;
			ExtractIconEx(file, number, out large, out small, 1);
			try {
				return Icon.FromHandle(largeIcon ? large : small);
			} catch {
				return null;
			}
		}
"@
}

@pbatard
Copy link
Owner

pbatard commented Sep 8, 2023

Thanks for the report and apologies for the late reply!

What you are describing, along with your analysis, makes sense, so I will apply your patch shortly.

@Tom-EllisEVENTS
Copy link
Author

Great! Thanks a lot!

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants