Skip to content

Conversation

@Megachip
Copy link
Contributor

@Megachip Megachip commented Jan 2, 2026

Generic Windows Support plus setting VCPU correcly.
Solving #1075

Copy link
Member

@g-bougard g-bougard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Megachip

thank you for your contribution.

I see few little problems with few required changes. Can you check my comments ?

Thank you

canRun('/Library/Application Support/VMware Fusion/vmrun') ||
canRun('vmrun');
canRun('vmrun') ||
canRun('C:\\\\Program Files (x86)\\\\VMware\\\\VMware Workstation\\\\vmrun.exe');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious: does VMware only provide 32-bits version installation ? If a 64-bits version exists, you have to handle it too.

Can you also try by using "/" path separator ? This should be supported by perl, even on windows.

Eventually to simplify code, you may want to use constant this way:

...

use constant WINDOW_VMRUN => 'C:/Program Files (x86)/VMware/VMWare Workstation/vmrun.exe';

sub isEnabled {
...
        canRun(WINDOWS_VMRUN);
...
        $command = '"'.WINDOWS_VMRUN.'" list';
...

Also, can you tell if the installation path can be changed ? In that case, we can't use a static file path.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whyever they are installed in (x86) even on 64 bit systems. Will check custom installation pathes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[debug] module GLPI::Agent::Task::Inventory::Virtualization::VmWareDesktop disabled: failure to load (Bareword "WINDOWS_VMRUN" not allowed while "strict subs" in use at C:/Apps/GAP/nightly/perl/agent/GLPI/Agent/Task/Inventory/Virtualization/VmWareDesktop.pm line 18.

Megachip and others added 4 commits January 2, 2026 18:17
SUBSYSTEM => "VmWare Fusion",
SUBSYSTEM => $subsystem,
VMTYPE => "VmWare",
COMMENT => $info{'annotation'},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the added "COMMENT" field, you must handle the case it is not defined to avoid perl warning when not defined:

Suggested change
COMMENT => $info{'annotation'},
COMMENT => $info{'annotation'} // "",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants