On Tue, 22 Apr 2025 07:29:08 GMT, Daishi Tabata <d...@openjdk.org> wrote:

> After searching the entire JDK source code, I found that WMIC is only used in 
> four files. These WMIC calls can be replaced with PowerShell for WMI.
> 
> The primary challenge in this replacement is to make it work the same as 
> before, even if the output format of the PowerShell command is different from 
> the original WMIC output. Where necessary, I've adjusted the output 
> formatting to maintain consistency.
> 
> Regarding the PowerShell options `-NoLogo`, `-NoProfile`, and 
> `-NonInteractive`, I've included them only when they are already used in the 
> surrounding code within the affected file.
> Note: In my environment, it worked correctly even without these options.
> 
> The `failure_handler` outputs powershell command execution results directly 
> into HTML. While the number and order of output items may differ slightly 
> after the modification, all previously output items are still included. 
> Therefore, I believe this is not a problem. Specific output changes are 
> located in:
> 
> - `environment.html`: `windows/system/os` section
> - `process.html`: `[Process ID]/windows/native/info` section
> 
> **Testing:**
> I have confirmed that all tests in `jdk/tools/jpackage` pass after these 
> changes.

This pull request has now been integrated.

Changeset: 4458719a
Author:    Daishi Tabata <tabata.dai...@fujitsu.com>
Committer: Magnus Ihse Bursie <i...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/4458719a108f45d3744d47a6ea081fe9ec3e675e
Stats:     32 lines in 4 files changed: 6 ins; 2 del; 24 mod

8355249: Remove the use of WMIC from the entire source code

Reviewed-by: erikj, ihse, asemenyuk

-------------

PR: https://git.openjdk.org/jdk/pull/24791

Reply via email to