How to build into a folder use vs2022

Background

  • I’ve modified some translations so far and would like to build and use them myself through the source code.
  • My system: win11
  • Tools used: vs2022
  • duplicati version: v2.1.0.4_stable_2025-01-31

Problems

  • The release zip file from github has all the data in one folder, e.g. Duplicati.GUI.TrayIcon.exe, Duplicati.CommandLine.exe, Duplicati.WindowsService.exe, etc. all together.
  • But my builds from vs2022 are scattered in different folders under Executables\net8, for example:
    • Duplicati.GUI.TrayIcon\bin\Release\net8.0\Duplicati.GUI.TrayIcon.exe
    • Duplicati.WindowsService\bin\Release\net8.0\Duplicati.WindowsService.exe
  • I tried installing the windows service in the Duplicati.WindowsService folder with the . \Duplicati.WindowsService.exe uninstall command in the Duplicati.WindowsService folder to install the windows service, it can be installed successfully, but can’t be started, I suspect it’s caused by directory separation.
  • The GitHub README.md mentions that there are related instructions for How-to-build-from-source in the wiki, but the current GitHub wiki is closed and cannot be viewed:
    ## Contributing Code
    
    Instructions on how to setup your development environment and build duplicati can be found in the [wiki](https://github.com/duplicati/duplicati/wiki/How-to-build-from-source).
    

Question

  • Can the Duplicati.WindowsService.exe builded by vs2022 be used alone? Or are there any conditions?
  • I would like to ask how it should be packaged to look like the contents of the zip in the github release?
  • Also wanted to ask what tools are typically used to package into msi?

Thanks!

Hi @ nadirvishun, welcome to the forum.

I have updated the README to point to the current location:

That executable is a thin wrapper for the Windows Service. Yes, it can be built by the .NET8 SDK, and by extension, also VS2022.

That is done by the tool ReleaseBuilder.

See the README:

Near the end is an example for how to build the zip files.

This is done with wixl from the msitools project. This does not work on Windows, but it should be somewhat compatible with WiX 3.

1 Like

Thank you for the help you provided.

I have done the following tests:

  • I used ReleaseBuilder to build and successfully packaged it into the same folder. Then I tested .\Duplicati.WindowsService.exe install, which could be set as a service normally and could be started and used normally.
  • However, when I use the separate directory Executables\net8\Duplicati.WindowsService\bin\Release\net8.0\Duplicati.WindowsService.exe install after building with vs2022, it can still be set as a service, but an error is prompted indicating that it cannot be started when starting.

New problems

  • Why can’t the detached version packaged by vs2022 be started after running Duplicati.WindowsService.exe install? Where can I view the relevant error logs?

As mentioned, the Duplicati.WindowsService.exe is wrapper service that needs something to run. If the file Duplicati.Server.exe does not exist in the folder where you are running from, the service will point to a non-existing file, and fail to start.

Look into the Windows Event Viewer to see the error messages.

1 Like