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

Windows (MSI) Installer Creation #134

Open
Tracked by #128
vikman90 opened this issue Sep 11, 2024 · 2 comments · May be fixed by #191
Open
Tracked by #128

Windows (MSI) Installer Creation #134

vikman90 opened this issue Sep 11, 2024 · 2 comments · May be fixed by #191
Assignees
Labels
level/subtask Subtask issue module/packages Agent packages type/enhancement Enhancement issue

Comments

@vikman90
Copy link
Member

vikman90 commented Sep 11, 2024

Parent Issue:

Description

This issue involves creating an MSI installer for Windows to simplify the installation of the Wazuh agent. The installer should ensure that the agent is correctly registered as a Windows Service and handle all required dependencies and installation tasks.

Functional Requirements

  • Develop an MSI installer for the Wazuh agent compatible with Windows platforms.
  • Ensure the installer correctly registers the agent as a Windows Service.
  • Implement any required pre/post-installation scripts to set up the agent.
  • Handle dependency installation as part of the MSI installer process.

Implementation Restrictions

  • Avoid using VB scripts, as the VBScript engine is planned to be deprecated (ref).

Acceptance Criteria

  • The MSI installer successfully installs the Wazuh agent.
  • The Wazuh agent is registered as a Windows Service and starts automatically after installation.
  • The installation, uninstallation, and upgrade processes are tested and verified on supported Windows versions.
@vikman90 vikman90 added type/enhancement Enhancement issue level/subtask Subtask issue phase/mvp module/packages Agent packages labels Sep 11, 2024
@jotacarma90 jotacarma90 linked a pull request Oct 1, 2024 that will close this issue
@jotacarma90 jotacarma90 self-assigned this Oct 1, 2024
@jotacarma90
Copy link
Member

jotacarma90 commented Oct 1, 2024

Update 01/10/2024

On hold

Update 18/11/2024

Update 19/11/2024

  • Local compilation completed after multiple dependency fixes in the process.
  • I continue to work on generating the same .vbs scripts into powershell .ps1 scripts.
  • Pending to generate package locally and analyze the process for further definition.

Update 20/11/2024

  • How to compile in local Windows 11 VM:

  • Current .ps1 scripts:

RemoveAllScript.zip
InstallerScript.zip

On hold

@vikman90 vikman90 removed the mvp label Oct 28, 2024
@wazuhci wazuhci moved this to In progress in Release 5.0.0 Nov 18, 2024
@wazuhci wazuhci moved this from In progress to On hold in Release 5.0.0 Nov 20, 2024
@wazuhci wazuhci moved this from On hold to In progress in Release 5.0.0 Dec 2, 2024
@wazuhci wazuhci moved this from In progress to On hold in Release 5.0.0 Dec 3, 2024
@wazuhci wazuhci moved this from On hold to In progress in Release 5.0.0 Dec 16, 2024
@jotacarma90
Copy link
Member

jotacarma90 commented Dec 17, 2024

Update 16/12/2024

  • I have picked up the issue where I left off.
  • Analysis of the current status of the package.
  • Review of the scripts made.
  • Researching the vbs deprecation and the current operation of the package generation script.
  • Progressing on the actual generation.

Update 17/12/2024

  • Checked complete flow, after successful compilation.
  • Moving necessary files and scripts to wazuh-agent/packages/windows
  • Adapting all left over or modified paths.
  • Continued to solve some problems and errors in the execution of the msi generation script.
  • Pending to adapt the compilation to the new script with the new agent steps.

Update 18/12/2024

  • Created PR with the necessary file movements: Create Windows installer MSI #191
  • Investigating error when installing the .exe to check that the paths are correct.
  • Example of errors to be fixed during package generation:
    Image
  • Continued working on the wxs script that contains each specific case of new files and directories.

Update 19/12/2024

  • Installation fixed and corrected the paths to be created.
  • During the development of the wxs script, I have found information about the CPack tool, with which it is feasible to generate the msi package from the cmake project, which seems much more convenient for our solution.

Update 20/12/2024

  • I was able to perform an installation with cmake --install and verify in the Windows eventviewer some errors related to the path of the configuration file. Solved.
  • I am investigating and analyzing the cpack settings to create the msi package.
  • Absolute path related errors in the cmakelist.

Update 23/12/2024

  • In-depth research on the creation of directories and files in CPACK.
  • Trying to find a way to use relative path to create the configuration directory in programdata.
  • Research on package generation techniques with CPACK.

Update 24/12/2024

  • The issue of relative paths has been solved. We are going to generate everything in an installation directory in “program files”, and then in a postinstall script create and move the rest of the paths.
  • Working with the different CPACK variables to pick up all the old wxs script operation.

Update 26/12/2024

  • Finally and after much research and trial and error I have managed to put together all the features of CPACK to end up generating an msi correctly.
  • At the moment, the agent is installed and a post install script is used to create the special directories, move the configuration file, and raise the Wazuh service.
  • The uninstall, upgrade and file signing functionalities are pending.

Update 27/12/2024

  • Fixed a few minor bugs in the package generation. Folder name, postinstall scripts, etc.
  • Added functionality to delete the data directory (except for a list of files that should not be deleted, such as the configuration file).
  • Complete check of current functionality.
  • Uploaded changes with all functionality.
  • Pending to add the functionality of the package signature and its files.

Update 30/12/2024

  • Working on package signature functionality and debug symbols.

@jotacarma90 jotacarma90 linked a pull request Dec 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/subtask Subtask issue module/packages Agent packages type/enhancement Enhancement issue
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

2 participants