Visual Studio Community 2022

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Answer
Olivier Schmitt
Messages: 45
Registration: Oct 22, 2024 - 1:25 p.m.

September 1, 2026 - 8:12 PM

Good morning,

I sometimes encounter installation errors with this package:
https://wapt.tranquil.it/store/fr/tis-v ... -community

Code: Select all

Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\common.py", line 4534, in install_wapt
    exitstatus = setup.install()
  File "C:\Program Files (x86)\wapt\private\tmp\waptb94tqg96\setup.py", line 102, in install
  File "C:\Program Files (x86)\wapt\common.py", line 4451, in new_func
    return func(*args, **kwargs)
  File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 1746, in install_exe_if_needed
    error('setup exe file %s not found in package' % exe)
  File "C:\Program Files (x86)\wapt\waptutils.py", line 2198, in error
    raise EWaptSetupException('Fatal error : %s' % reason)
waptutils.EWaptSetupException: Fatal error : setup exe file C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe not found in package

EWaptSetupException: Fatal error : setup exe file C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe not found in package

Here is the function in question:

Code: Select all

# Upgrading the software
    [b]if installed_softwares(name=app_name) and need_install(name=app_name, min_version=control.get_software_version()):[/b]
       [b] bin_path = makepath(programfiles32, "Microsoft Visual Studio", "Installer", "setup.exe")[/b]
        install_exe_if_needed(
            bin_path,
            # /finalizeInstall --passive or --quiet
            silentflags=r'update --layoutPath "C:\localVSlayout" --in "C:\localVSlayout\Response.json" --force --nocache --noUpdateInstaller --noWeb --quiet --norestart',
            name=app_name,
            min_version=control.get_software_version(),
            get_version = get_version,
            timeout=2500,
            # time_wait_uninstallkey_present=5000,
        )

Indeed, sometimes installed_softwares(name=app_name) returns:

Code: Select all

>>> from setuphelpers import *
>>> bin_name = "vs_setup.exe"
>>> app_name = "Visual Studio Community 2022"
>>> dir_name = "localVSlayout"
>>> temp_dir = makepath(systemdrive, dir_name)
>>> app_dir = makepath(programfiles,"Microsoft Visual Studio","2022")
>>>[b] installed_softwares(name=app_name)[/b]
[{'key': '908e4091', 'name': 'Visual Studio Community 2022', 'version': '17.14.36', 'install_date': '2026-07-15 00:00:00', 'install_location': 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community', 'uninstall_string': '"C:\\Program Files (x86)\\Microsoft Visual Stud
io\\Installer\\setup.exe" uninstall --installPath "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community"', 'publisher': 'Microsoft Corporation', 'system_component': 0, 'win64': False}]
But that this does not exist:

Code: Select all

C:\Windows\System32\config\systemprofile>dir "c:\Program Files (x86)\Microsoft Visual Studio\
 Le volume dans le lecteur C s’appelle Windows
 Le numéro de série du volume est 60CB-EC76

 Répertoire de c:\Program Files (x86)\Microsoft Visual Studio

29/07/2026  11:34    <DIR>          .
01/09/2026  19:19    <DIR>          ..
15/07/2026  16:13    <DIR>          Shared
               0 fichier(s)                0 octets
               3 Rép(s)  176 418 471 936 octets libres

To resolve the issue, I need to remove the uninstaller registry entry using the commands below, then delete the folders as specified in the uninstall function, and the localVSlayout folder:

Code: Select all

>>> soft = installed_softwares(name="Visual Studio Community 2022")
>>> soft
[{'key': '908e4091', 'name': 'Visual Studio Community 2022', 'version': '17.14.36', 'install_date': '2026-07-15 00:00:00', 'install_location': 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community', 'uninstall_string': '"C:\\Program Files (x86)\\Microsoft Visual Stud
io\\Installer\\setup.exe" uninstall --installPath "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community"', 'publisher': 'Microsoft Corporation', 'system_component': 0, 'win64': False}]
>>> unregister_uninstall(soft[0]["key"])
>>> installed_softwares(name="Visual Studio Community 2022")
[]
>>>
Would it be possible to add the following to def uninstall():

Code: Select all

soft = installed_softwares(name="Visual Studio Community 2022")
if soft:
    unregister_uninstall(soft[0]["key"])[/b]
Or perhaps it would be better to test it this way in the install function:

Code: Select all

    if installed_softwares(name=app_name) and need_install(name=app_name, min_version=control.get_software_version()):
        bin_path = makepath(programfiles32, "Microsoft Visual Studio", "Installer", "setup.exe")
        if isfile(bin_path):
        install_exe_if_needed(
            bin_path,
            # /finalizeInstall --passive or --quiet
            silentflags=r'update --layoutPath "C:\localVSlayout" --in "C:\localVSlayout\Response.json" --force --nocache --noUpdateInstaller --noWeb --quiet --norestart',
            name=app_name,
            min_version=control.get_software_version(),
            get_version = get_version,
            timeout=2500,
            # time_wait_uninstallkey_present=5000,
        )
italbot
Messages: 94
Registration: Sep 26, 2023 - 3:50 p.m.

September 2, 2026 - 10:18

Hello,

I can look into this. Are you experiencing this issue with any particular versions? So I can test it on my end.

Regards,

Ingrid
Tranquil IT
Answer