Code Monkey home page Code Monkey logo

start-apps's Introduction

start-apps

Get a list of apps in the Start Menu, with details. Supports classic (desktop) and store (UWP) apps. For store apps, the paths to their icons are included.

This project is part of #CreateWeekly, my attempt to create something new publicly every week in 2020.

Installation

npm install -g @josephuspaye/start-apps

Example

The following program gets all the apps in the Start Menu and dumps the list in JSON format:

import { getApps } from '@josephuspaye/start-apps';

async function main() {
  const apps = await getApps();
  console.log(JSON.stringify(apps, null, '  '));
}

main();
View partial output
[
  {
    type: 'store',
    name: 'Mail',
    appUserModelId:
      'microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.mail',
    packagePath:
      'C:\\Program Files\\WindowsApps\\microsoft.windowscommunicationsapps_16005.13228.41011.0_x64__8wekyb3d8bbwe',
    packageImages: {
      backgroundColor: '#0078D7',
      icon: {
        default:
          'C:\\Program Files\\WindowsApps\\microsoft.windowscommunicationsapps_16005.13228.41011.0_x64__8wekyb3d8bbwe\\images\\HxMailAppList.scale-400.png',
      },
      tile: {
        default:
          'C:\\Program Files\\WindowsApps\\microsoft.windowscommunicationsapps_16005.13228.41011.0_x64__8wekyb3d8bbwe\\images\\HxMailMediumTile.scale-400.png',
      },
    },
  },
  {
    type: 'classic',
    name: 'Zoom',
    appUserModelId: 'zoom.us.Zoom Video Meetings',
    targetPath: 'C:\\Users\\jpaye\\AppData\\Roaming\\Zoom\\bin\\Zoom.exe',
    targetArguments: '',
    startMenuLink:
      'C:\\Users\\jpaye\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Zoom\\Zoom.lnk',
  },
  // ...more apps...
];

API

interface ClassicApp {
  type: 'classic';
  name: string;
  appUserModelId: string;
  targetPath: string;
  targetArguments: string;
  startMenuLink?: string;
}

interface Image {
  default?: string;
  onBlack?: string;
  onWhite?: string;
}

interface Images {
  backgroundColor: string;
  icon: Image;
  tile: Image;
}

interface StoreApp {
  type: 'store';
  name: string;
  appUserModelId: string;
  packagePath: string;
  packageImages?: Images;
}

type App = ClassicApp | StoreApp;

/**
 * Get all apps in the Start Menu
 */
function getApps(): Promise<App[] | undefined>;

Building the StartApps binary from source

The Node.js library uses a binary built from a .NET Core project to list the apps and their details. The source of this project is at StartAppsProject. You can build the project to get a binary as follows:

  • Install Visual Studio Community (the project was created using the 2019 version)
  • Clone this repo and double-click the StartApps.csproj file in the project directory to open it in Visual Studio
  • In the Visual Studio application menu, click "Build" โ†’ "Publish StartApps"
  • Choose "For NPM - Win x64, Framework-dependant" in the dropdown menu on the publish page and click "Publish" to build the binary
  • Find the built binary in bin\Release\netcoreapp3.1\publish

Licence

MIT

start-apps's People

Contributors

josephuspaye avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.