• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 31083928084

06 Aug 2026 08:12AM UTC coverage: 72.616% (+0.006%) from 72.61%
31083928084

Pull #2258

github

web-flow
Merge 276049d85 into cd9770b9c
Pull Request #2258: #2250 uninstall commands from package manager

5038 of 7697 branches covered (65.45%)

Branch coverage included in aggregate %.

13137 of 17332 relevant lines covered (75.8%)

3.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

6.67
cli/src/main/java/com/devonfw/tools/ide/tool/pgadmin/PgAdmin.java
1
package com.devonfw.tools.ide.tool.pgadmin;
2

3
import java.nio.file.Files;
4
import java.nio.file.Path;
5
import java.nio.file.Paths;
6
import java.util.List;
7
import java.util.Set;
8

9
import com.devonfw.tools.ide.common.Tag;
10
import com.devonfw.tools.ide.context.IdeContext;
11
import com.devonfw.tools.ide.os.WindowsHelper;
12
import com.devonfw.tools.ide.tool.GlobalToolCommandlet;
13
import com.devonfw.tools.ide.tool.NativePackage;
14
import com.devonfw.tools.ide.tool.NativePackageManager;
15
import com.devonfw.tools.ide.version.VersionIdentifier;
16

17
/**
18
 * {@link GlobalToolCommandlet} for <a href="https://www.pgadmin.org/">pgadmin</a>
19
 */
20
public class PgAdmin extends GlobalToolCommandlet {
21

22
  /**
23
   * The constructor.
24
   *
25
   * @param context the {@link IdeContext}.
26
   */
27
  public PgAdmin(IdeContext context) {
28

29
    super(context, "pgadmin", Set.of(Tag.DB, Tag.ADMIN));
7✔
30
  }
1✔
31

32
  @Override
33
  protected List<NativePackage> getNativePackages() {
34
    return List.of(new NativePackage(
×
35
        NativePackageManager.APT,
36
        List.of("pgadmin4", "pgadmin4-server", "pgadmin4-desktop", "pgadmin4-web"),
×
37
        List.of("--allow-downgrades"),
×
38
        List.of("curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --yes --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg",
×
39
            "sudo sh -c 'echo \"deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] "
40
                + "https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main\" "
41
                + "> /etc/apt/sources.list.d/pgadmin4.list && apt update'"),
42
        List.of("sudo rm -f /etc/apt/sources.list.d/pgadmin4.list", "sudo rm -f /usr/share/keyrings/packages-pgadmin-org.gpg")
×
43
    ));
44
  }
45

46
  @Override
47
  protected String getBinaryName() {
48

49
    return "pgadmin4";
×
50
  }
51

52
  @Override
53
  protected Path getInstallationPath(String edition, VersionIdentifier resolvedVersion) {
54
    if (super.getInstallationPath(edition, resolvedVersion) == null) {
×
55
      if (this.context.getSystemInfo().isWindows()) {
×
56
        return getExecutableFolderFromWindowsRegistry();
×
57
      }
58
    }
59
    return null;
×
60
  }
61

62
  private Path getExecutableFolderFromWindowsRegistry() {
63

64
    WindowsHelper windowsHelper = WindowsHelper.get(this.context);
×
65
    String registryPath = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\pgAdmin 4v9_is1";
×
66
    String displayIcon = windowsHelper.getRegistryValue(registryPath, "DisplayIcon");
×
67
    if (displayIcon != null) {
×
68
      Path executablePath = Paths.get(displayIcon);
×
69
      if (Files.isExecutable(executablePath)) {
×
70
        Path installationDir = executablePath.getParent();
×
71
        this.context.getPath().setPath(getName(), installationDir);
×
72
        return installationDir;
×
73
      }
74
    }
75
    return null;
×
76
  }
77
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc