OCSInventory-NG / OCSInventory-ocsreports

Webconsole for OCS Inventory NG
https://www.ocsinventory-ng.org
GNU General Public License v2.0
229 stars 150 forks source link

[BUG] Install EXE - executable.exe is missing (2.12.0) #1541

Closed LMS235 closed 1 year ago

LMS235 commented 1 year ago

OCS Inventory version Version : 2.12.0

Describe the bug In 2.11.1 build a normal EXE: NAME="executable.exe /S /user=all" In 2.12.0 build a normal EXE: NAME="/S /user=all" => "executable.exe" is missing => deployment won't work

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Deployment' => 'Build'
  2. Click on 'Windows' => 'Install / Uninstall' => 'Execute an exe'
  3. Create an EXE Install and see the info file....

Expected behavior As of now, the whole deployment feature in 2.12.0 is not really functional (see also https://github.com/OCSInventory-NG/OCSInventory-ocsreports/issues/1536). This must change as soon as possible!

LMS235 commented 1 year ago

the error is in the adjustments in the file ~/ocsreports/require/teledeploy/PackageBuilder.php

fastest solution as workaround is to use the "old" file (PackageBuilder.php) from 2.11.1, then at least the deployment of Windows works clean again (EXE and CUSTOM EXE - https://github.com/OCSInventory-NG/OCSInventory-ocsreports/issues/1536)

something between line 400 and 409 is wrong:

        if ($xmlDetails->packagedefinition->ACT  == 'LAUNCH' && $xmlDetails->formoption->ISCUSTOM == false) {
            // if pkg built from linux bashscript option and not custom package, 
            // default retrieved if a command but w/ LAUNCH, the agent will be expecting a name
            $name = substr($xmlDetails->packagedefinition->COMMAND, strpos($xmlDetails->packagedefinition->COMMAND, ' ') + 1);
            $info .= "NAME=\"" . $name . "\" ";

        } else if ($xmlDetails->packagedefinition->ACT  == 'LAUNCH') {
            $info .= "NAME=\"" . $xmlDetails->packagedefinition->COMMAND . "\" ";
        }
charleneauger commented 1 year ago

Hi @LMS235 ,

I made some fixes related to your issues. You will find them in the following PR : #1542

Best regards, Charlene

LMS235 commented 1 year ago

tested --> work