I have a Software Deploy package built to install the Qualys agent on servers in the DMZ.
The package runs but starts in an evaluation state for a long time then to a running state and sits there. The file is copied down to the server. I have installed the software on a server using the same commands from the cmd prompt and it installs without and issue. The action script that runs is rather large but to break it down what what it is going to do is as follows:
// ---------------------------------------------EDITING INSTRUCTIONS---------------------------------------------------------------------
// When editing this task through the Manage Software Distribution Packages dashboard, you will have the option to preserve any custom edits you make to this action.
// If you select the option to preserve custom edits, only areas bound by the comment markers âPreparation Markerâ, âCommand Markerâ and âClosing Markerâ are updated.
// To ensure that all your custom Action Script changes can be preserved, only make changes to areas that are not bound by the comment markers.
// Removing the comment markers may result in the Action Script not updating correctly during the next edit.
// See KB Article swg21668807 (https://hclpnpsupport.service-now.com/csm?id=kb_article&sysparm_article=KB0023414) for more information.
// --------------------------------------------------------------------------------------------------------------------------------------
//**Begin Preparation Marker
// Download all specified files
begin prefetch block
add prefetch item name=3890faaa98fa80502c3690e78ca8416a3c1746c8 sha1=3890faaa98fa80502c3690e78ca8416a3c1746c8 size=22246464 url=SWDProtocol://127.0.0.1:52311/Uploads/3890faaa98fa80502c3690e78ca8416a3c1746c8/QualysCloudAgent.exe.bfswd sha256=85226b4faeed4fd8046ce40dbbd775702b37567b04ae5239f15c2cac1098ff6d
end prefetch block
// All SWD files will go into a folder in the clients __BESData folder. This folder gets cleared on every restart.
parameter âbaseFolderâ = â__Download/â
// Move files into subfolders and unescape file names
move â__Download/3890faaa98fa80502c3690e78ca8416a3c1746c8â â{parameter âbaseFolderâ}QualysCloudAgent.exeâ
// Log setup
parameter âmainSWDLogFolderâ = "{parent folder of client folder of current site}/__Global/SWDDeployData"
folder create "{parameter âmainSWDLogFolderâ}"
parameter âlogFileâ = âSWD_DeploymentResults.logâ
//**End Preparation Marker
delete __createfile
parameter âlogFolderâ = â{parameter âmainSWDLogFolderâ}â
// Run setup process
delete run.bat
// Use .bat to set working directory to packages root, for setup command.
createfile until end
@ECHO OFF
cd "{parameter âbaseFolderâ}"
rem // See comments at the beginning of this action for an explanation of the comment markers.
echo %DATE% %TIME% >> "{parameter âlogFolderâ}{parameter âlogFileâ}"
echo Action ID: {id of active action} >> "{parameter âlogFolderâ}{parameter âlogFileâ}"
rem //**Begin Command Marker
echo Command: QualysCloudAgent.exe CustomerId={#############} ActivationId={########} WebServiceUri=https://qagpublic.qg2.apps.qualys.com/CloudAgent/ >> "{parameter âlogFolderâ}{parameter âlogFileâ}"
set errorlevel=
QualysCloudAgent.exe CustomerId={########} ActivationId={########} WebServiceUri=https://qagpublic.qg2.apps.qualys.com/CloudAgent/ >> â{parameter âlogFolderâ}{parameter âlogFileâ}â 2>&1
set SWDExitCode=%errorlevel%
rem //**End Command Marker
echo Return code: %SWDExitCode% >> "{parameter âlogFolderâ}{parameter âlogFileâ}"
echo. >> "{parameter âlogFolderâ}{parameter âlogFileâ}"
exit %SWDExitCode%
end
move __createfile run.bat
// You will not be able to stop or take action on an applicable BigFix Client until your installer completes.
// So ensure no user input is required.
// If your package absolutely must interact with the user, replace âoverride waitâ with âoverride runâ and âwaitâ with ârunâ.
override wait
hidden=true
completion=job
wait run.bat
//**Begin Closing Marker
// Get the return code of the previous action.
parameter âreturnCodeâ = â{exit code of action}â
// Task will now exit.
exit {parameter âreturnCodeâ}
//**End Closing Marker