Skip to content

A lightweight, zero-dependency Windows application manager for listing, launching, and managing UWP apps via PowerShell.

Notifications You must be signed in to change notification settings

safwa1/AppXplorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppXplorer

AppXplorer Logo

A lightweight, zero-dependency Windows application manager for listing, launching, and managing UWP apps via PowerShell.

NuGet License: MIT .NET Windows Downloads

📋 Table of Contents

Overview

AppXplorer is a .NET library that provides a simple and efficient way to interact with Windows Store (UWP) applications. It allows developers to list installed applications, retrieve app information, launch apps, and create desktop shortcuts - all through a clean and intuitive API.

✨ Features

🔄 Zero Dependencies

Built using only .NET standard libraries, ensuring minimal footprint and maximum compatibility

📋 App Discovery

List and filter all installed Windows Store (UWP) applications

📊 Detailed Information

Retrieve comprehensive app details including install location, version, package family name, and more

▶️ App Management

Launch applications programmatically with simple API calls

🔗 Desktop Integration

Create desktop shortcuts for UWP applications with a single method call

🔄 Multi-Target Support

Compatible with .NET 8.0 and .NET 9.0

🚀 Installation

Via NuGet Package Manager

Install-Package AppXplorer

Via .NET CLI

dotnet add package AppXplorer

Via Package Reference in .csproj

<PackageReference Include="AppXplorer" Version="latest" />

📝 Usage Examples

List All Installed UWP Apps

using AppXplorer;
using System;
using System.Threading.Tasks;

public class AppListExample
{
    public static async Task ListAllApps()
    {
        // Get all installed UWP apps
        var apps = await AppxManager.GetInstalledApps();
        
        Console.WriteLine($"Found {apps.Count} installed UWP applications:");
        
        foreach (var app in apps)
        {
            Console.WriteLine($"Name: {app.Name}");
            Console.WriteLine($"AppID: {app.AppId}");
        }
    }
}

Check If an App Is Installed

using AppXplorer;
using System;
using System.Threading.Tasks;

public class AppCheckExample
{
    public static async Task CheckAppInstallation(string appName)
    {
        // Check if an app is installed
        bool isInstalled = await AppxManager.IsInstalled(appName);
        
        Console.WriteLine($"{appName} is {(isInstalled ? "installed" : "not installed")} on this system.");
        
        if (isInstalled)
        {
            // Get additional information if installed
            string version = await AppxManager.GetVersion(appName);
            string location = await AppxManager.GetInstallLocation(appName);
            
            Console.WriteLine($"Version: {version}");
            Console.WriteLine($"Location: {location}");
        }
    }
}

Get App Information

using AppXplorer;
using AppXplorer.Types;
using System;
using System.Threading.Tasks;

public class AppInfoExample
{
    public static async Task GetAppDetails(string appName)
    {
        try
        {
            // Get app version
            string version = await AppxManager.GetVersion(appName);
            Console.WriteLine($"{appName} version: {version}");

            // Get install location
            string location = await AppxManager.GetInstallLocation(appName);
            Console.WriteLine($"{appName} is installed at: {location}");

            // Get app manifest
            string manifest = await AppxManager.ReadManifest(appName);
            Console.WriteLine($"Manifest preview: {manifest.Substring(0, Math.Min(100, manifest.Length))}...");
            
            // Get full app details
            var appDetails = await AppxManager.GetAppDetails(appName);
            Console.WriteLine($"Package Family Name: {appDetails.PackageFamilyName}");
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error retrieving app information: {ex.Message}");
        }
    }
}

Launch an App

using AppXplorer;
using System;
using System.Threading.Tasks;

public class AppLaunchExample
{
    public static async Task LaunchApplication(string appName)
    {
        try
        {
            // Verify app exists before attempting to launch
            if (await AppxManager.IsInstalled(appName))
            {
                Console.WriteLine($"Launching {appName}...");
                await AppxManager.LaunchApp(appName);
                Console.WriteLine("Launch command sent successfully.");
            }
            else
            {
                Console.WriteLine($"Cannot launch {appName} - application not found.");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error launching application: {ex.Message}");
        }
    }
}

Create a Desktop Shortcut

using AppXplorer;
using System;
using System.Threading.Tasks;

public class ShortcutExample
{
    public static async Task CreateAppShortcut(string appName)
    {
        try
        {
            // Create a desktop shortcut for an app
            await AppxManager.CreateShortcut(appName);
            Console.WriteLine($"Desktop shortcut created for {appName}");
            
            // You can also specify a custom shortcut name
            // await AppxManager.CreateShortcut(appName, customName: "My Custom App Name");
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error creating shortcut: {ex.Message}");
        }
    }
}

⚙️ API Reference

AppxManager Class

The main class providing access to UWP application functionality:

Method Description
GetInstalledApps() Returns a list of all installed UWP applications
IsInstalled(string appName) Checks if a specific app is installed
GetVersion(string appName) Gets the version of an installed app
GetInstallLocation(string appName) Gets the installation directory of an app
ReadManifest(string appName) Retrieves the app's manifest XML
LaunchApp(string appName) Launches the specified application
CreateShortcut(string appName, string customName = null) Creates a desktop shortcut for the app
GetAppDetails(string appName) Gets comprehensive details about an app

Appx Class

Represents a UWP application with properties:

Property Type Description
Name string The display name of the application
AppId string The unique identifier for the app
Publisher string The publisher of the application
Version string The version of the application
InstallLocation string Where the app is installed
PackageFamilyName string The package family name

🔍 Performance Considerations

  • PowerShell Execution: AppXplorer uses PowerShell under the hood, which may have a small startup cost on the first call. Subsequent calls are typically faster.

  • Large App Collections: When working with systems that have many UWP apps installed, consider implementing pagination or filtering when displaying results to users.

  • Caching: For frequently accessed information, consider implementing a caching layer to reduce repeated PowerShell calls.

❓ Troubleshooting

Common Issues

  1. App Not Found

    • Ensure you're using the exact display name of the application
    • Try using wildcard search: await AppxManager.GetInstalledApps("*partial name*")
  2. Permission Issues

    • Make sure your application has sufficient permissions to execute PowerShell commands
    • On some systems, you may need to run your application as Administrator
  3. PowerShell Execution Policy

    • If you encounter execution policy errors, you may need to adjust your system's PowerShell execution policy
  4. App Launch Failures

    • Some UWP apps may have specific launch requirements or may not support programmatic launching
    • Check the app's capabilities in its manifest

📋 Requirements

  • Windows 10 or later
  • .NET 8.0 or .NET 9.0
  • PowerShell 5.1 or later

🤝 Contributing

Contributions are welcome! If you'd like to contribute to this project, please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

  1. Clone the repository
  2. Open the solution in Visual Studio or your preferred IDE
  3. Build the solution to restore dependencies
  4. Run the tests to ensure everything is working correctly

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author


Made with ❤️ for the Windows developer community.

⬆ Back to top

About

A lightweight, zero-dependency Windows application manager for listing, launching, and managing UWP apps via PowerShell.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages