### Install Dependencies and Start Dev Server Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/dev-environment/javascript/react-on-windows.md Navigate into your new app directory, install the necessary dependencies, and start the local development server. The app will be accessible at http://localhost:5173. Press Ctrl+C to stop the server. ```bash cd my-react-app npm install npm run dev ``` -------------------------------- ### Example response for unpackaged application installation check Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/monetize/send-requests-to-the-store.md This is an example of the JSON response received after checking the installation status of an unpackaged application. ```json { "isInstalled": false } ``` -------------------------------- ### Install Dependencies and Start Dev Server Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/dev-environment/javascript/vue-on-windows.md After creating your Vue project, navigate into the project folder, install necessary dependencies, and start the development server. Your app will be accessible at http://localhost:5173. ```bash cd npm install npm run dev ``` -------------------------------- ### Build Installer Script Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/powertoys/command-palette/publish-extension-winget.md This PowerShell script automates the process of building an installer for your extension. It checks for published files, creates a platform-specific setup script using Inno Setup templates, and then invokes Inno Setup to generate the final installer executable. It includes checks for Inno Setup installation and reports success or failure. ```powershell $publishDir = "$ProjectDir\bin\$Configuration\win-$Platform\publish" $fileCount = (Get-ChildItem -Path $publishDir -Recurse -File).Count Write-Host "✅ Published $fileCount files to $publishDir" -ForegroundColor Green # Create platform-specific setup script Write-Host "Creating installer script for $Platform..." -ForegroundColor Yellow $setupTemplate = Get-Content "$ProjectDir\setup-template.iss" -Raw # Update version $setupScript = $setupTemplate -replace '#define AppVersion ".*"', "#define AppVersion \"$Version\"" # Update output filename to include platform suffix $setupScript = $setupScript -replace 'OutputBaseFilename=(.*?)\{#AppVersion\}', "OutputBaseFilename=`$1\{#AppVersion}-$Platform" # Update source path for the platform $setupScript = $setupScript -replace 'Source: "bin\Release\win-x64\publish', "Source: `"bin\Release\win-$Platform\publish" # Add architecture settings after [Setup] section if ($Platform -eq "arm64") { $setupScript = $setupScript -replace '(\[Setup\][^\[]*)(MinVersion=)', "`$1ArchitecturesAllowed=arm64`r`nArchitecturesInstallIn64BitMode=arm64`r`n`$2" } else { $setupScript = $setupScript -replace '(\[Setup\][^\[]*)(MinVersion=)', "`$1ArchitecturesAllowed=x64compatible`r`nArchitecturesInstallIn64BitMode=x64compatible`r`n`$2" } $setupScript | Out-File -FilePath "$ProjectDir\setup-$Platform.iss" -Encoding UTF8 # Create installer with Inno Setup Write-Host "Creating $Platform installer with Inno Setup..." -ForegroundColor Yellow $InnoSetupPath = "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" if (-not (Test-Path $InnoSetupPath)) { $InnoSetupPath = "${env:ProgramFiles}\Inno Setup 6\iscc.exe" } if (Test-Path $InnoSetupPath) { & $InnoSetupPath "$ProjectDir\setup-$Platform.iss" if ($LASTEXITCODE -eq 0) { $installer = Get-ChildItem "$ProjectDir\bin\$Configuration\installer\*-$Platform.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 if ($installer) { $sizeMB = [math]::Round($installer.Length / 1MB, 2) Write-Host "✅ Created $Platform installer: $($installer.Name) ($sizeMB MB)" -ForegroundColor Green } else { Write-Warning "Installer file not found for $Platform" } } else { Write-Warning "Inno Setup failed for $Platform with exit code: $LASTEXITCODE" } } else { Write-Warning "Inno Setup not found at expected locations" } } Write-Host "`n🎉 Build completed successfully!" -ForegroundColor Green ``` -------------------------------- ### Call Start Recording to File - C++ Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/gaming/capture-game-audio-video-screenshots-and-metadata.md A basic example demonstrating how to call the StartRecordingToFileAsync method to begin recording. ```cpp // Start recording to a file concurrency::task recordingTask = AppRecordingManager::GetCurrent().StartRecordingToFileAsync(outputFileName); ``` -------------------------------- ### Example output of installed Windows App SDK packages Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/windows-app-sdk/check-windows-app-sdk-versions.md This is an example of the output you might see when checking for Windows App SDK packages. It details package names, publishers, architectures, versions, and installation locations. ```console Name : Microsoft.WindowsAppRuntime.1.0 Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US Architecture : X64 ResourceId : Version : 0.318.928.0 PackageFullName : Microsoft.WindowsAppRuntime.1.0_0.318.928.0_x64__8wekyb3d8bbwe InstallLocation : C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.0_0.318.928.0_x64__8wekyb3d8bbwe IsFramework : True PackageFamilyName : Microsoft.WindowsAppRuntime.1.0_8wekyb3d8bbwe PublisherId : 8wekyb3d8bbwe IsResourcePackage : False IsBundle : False IsDevelopmentMode : False NonRemovable : False IsPartiallyStaged : False SignatureKind : Store Status : Ok Name : Microsoft.WindowsAppRuntime.1.0 Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US Architecture : X86 ResourceId : Version : 0.318.928.0 PackageFullName : Microsoft.WindowsAppRuntime.1.0_0.318.928.0_x86__8wekyb3d8bbwe InstallLocation : C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.0_0.318.928.0_x86__8wekyb3d8bbwe IsFramework : True PackageFamilyName : Microsoft.WindowsAppRuntime.1.0_8wekyb3d8bbwe PublisherId : 8wekyb3d8bbwe IsResourcePackage : False IsBundle : False IsDevelopmentMode : False NonRemovable : False IsPartiallyStaged : False SignatureKind : Store Status : Ok Name : MicrosoftCorporationII.WindowsAppRuntime.Main.1.0 Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US Architecture : X64 ResourceId : Version : 0.318.928.0 PackageFullName : MicrosoftCorporationII.WindowsAppRuntime.Main.1.0_0.318.928.0_x64__8wekyb3d8bbwe InstallLocation : C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsAppRuntime.Main.1.0_0.318.928.0_x64__8wekyb3d8bbwe IsFramework : False PackageFamilyName : MicrosoftCorporationII.WindowsAppRuntime.Main.1.0_8wekyb3d8bbwe PublisherId : 8wekyb3d8bbwe IsResourcePackage : False IsBundle : False IsDevelopmentMode : False NonRemovable : False Dependencies : {Microsoft.WindowsAppRuntime.1.0_0.318.928.0_x64__8wekyb3d8bbwe} IsPartiallyStaged : False SignatureKind : Store Status : Ok Name : Microsoft.WindowsAppRuntime.Singleton Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US Architecture : X64 ResourceId : Version : 0.318.928.0 PackageFullName : Microsoft.WindowsAppRuntime.Singleton_0.318.928.0_x64__8wekyb3d8bbwe InstallLocation : C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.Singleton_0.318.928.0_x64__8wekyb3d8bbwe IsFramework : False PackageFamilyName : Microsoft.WindowsAppRuntime.Singleton_8wekyb3d8bbwe PublisherId : 8wekyb3d8bbwe IsResourcePackage : False IsBundle : False IsDevelopmentMode : False NonRemovable : False Dependencies : {Microsoft.WindowsAppRuntime.1.0_0.318.928.0_x64__8wekyb3d8bbwe} IsPartiallyStaged : False SignatureKind : Store Status : Ok Name : Microsoft.WinAppRuntime.DDLM.0.318.928.0-x6 Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US Architecture : X64 ResourceId : Version : 0.318.928.0 PackageFullName : Microsoft.WinAppRuntime.DDLM.0.318.928.0-x6_0.318.928.0_x64__8wekyb3d8bbwe InstallLocation : C:\Program Files\WindowsApps\Microsoft.WinAppRuntime.DDLM.0.318.928.0-x6_0.318.928.0_x64__8wekyb3d8bbwe IsFramework : False PackageFamilyName : Microsoft.WinAppRuntime.DDLM.0.318.928.0-x6_8wekyb3d8bbwe PublisherId : 8wekyb3d8bbwe IsResourcePackage : False IsBundle : False IsDevelopmentMode : False NonRemovable : False Dependencies : {Microsoft.WindowsAppRuntime.1.0_0.318.928.0_x64__8wekyb3d8bbwe} IsPartiallyStaged : False SignatureKind : Developer Status : Ok Name : Microsoft.WinAppRuntime.DDLM.0.318.928.0-x8 Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US Architecture : X86 ResourceId : Version : 0.318.928.0 PackageFullName : Microsoft.WinAppRuntime.DDLM.0.318.928.0-x8_0.318.928.0_x86__8wekyb3d8bbwe InstallLocation : C:\Program Files\WindowsApps\Microsoft.WinAppRuntime.DDLM.0.318.928.0-x8_0.318.928.0_x86__8wekyb3d8bbwe IsFramework : False ``` -------------------------------- ### Verify Local Build Environment Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/powertoys/command-palette/publish-extension-winget.md Before building the installer, verify that .NET 9 and Inno Setup are installed and accessible. These commands check their versions and installation paths. ```powershell # verify .Net 9 is installed dotnet --version # verify Inno Setup is installed Test-Path "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" # build installer, this step takes a while .\build-exe.ps1 -Version "0.0.1.0" # verify that -Setup-0.0.1.0.exe is listed Get-ChildItem "bin\Release\installer\" -File ``` -------------------------------- ### Example JSON Response Body for Desktop App Installs Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/monetize/get-desktop-app-installs.md This JSON object represents a sample response from an API call to retrieve desktop application install data. It includes an array of install records, a link for fetching subsequent pages of data if the result set is large, and the total count of records matching the query. ```json { "Value": [ { "date": "2018-01-24", "applicationId": "123456789", "productName": "Contoso Demo", "applicationVersion": "1.0.0.0", "deviceType": "PC", "market": "All", "osVersion": "Windows 10", "osRelease": "Version 1709", "installBase": 348218.0 } ], "@nextLink": "desktop/installbasedaily?applicationId=123456789&startDate=2018-01-01&endDate=2018-02-01&top=10000&skip=10000&groupby=applicationVersion,deviceType,osVersion,osRelease", "TotalCount": 23012 } ``` -------------------------------- ### Query Ad Campaigns - GET Request with Parameters Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/monetize/manage-ad-campaigns.md Use this example to query for a set of ad campaigns, with options to filter and sort. This specific example sorts by 'createdDateTime' and fetches 100 campaigns, starting from the first one. ```json GET https://manage.devcenter.microsoft.com/v1.0/my/promotion/campaign?storeProductId=9nblggh42cfd&fetch=100&skip=0&campaignSetSortColumn=createdDateTime HTTP/1.1 Authorization: Bearer ``` -------------------------------- ### Registry Setup for DLP Provider Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/develop/windows-integration/recall/dlp-provider-api.md Example of a registry entry for a DLP provider, specifying the installation path of the DLL. Harden this key to prevent unauthorized modifications. ```registry HKEY_LOCAL_MACHINE\SOFTWARE\YourCompany\DLP InstallPath REG_SZ C:\ Program Files\YourCompany\DLP ``` -------------------------------- ### Example Usage for Setting Certificate Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/debug-test-perf/device-portal-ssl.md Examples demonstrating how to use the WebManagement.exe command with different .pfx file names and passwords. ```cmd WebManagement.exe -SetCert localhost.pfx PickAPassword ``` ```cmd WebManagement.exe -SetCert --1.pfx PickAPassword ``` ```cmd WebManagement.exe -SetCert MyLivingRoomPC.pfx PickAPassword ``` -------------------------------- ### Example Resource Files Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/app-resources/how-rms-matches-and-chooses-resources.md These are the available resource files before matching. ```console en/images/logo.scale-400.jpg en/images/logo.scale-200.jpg en/images/logo.scale-100.jpg fr/images/logo.scale-100.jpg fr/images/contrast-high/logo.scale-400.jpg fr/images/contrast-high/logo.scale-100.jpg de/images/logo.jpg ``` -------------------------------- ### Get App Installation Status Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/debug-test-perf/device-portal-api-core.md Use this GET request to check the status of an ongoing app installation. A 204 status code indicates the installation is currently running. ```HTTP GET /api/app/packagemanager/state ``` -------------------------------- ### Initialize C++ Example Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/api-reference/bootstrapper-cpp-api/microsoft.windows.applicationmodel.dynamicdependency.bootstrap/microsoft.windows.applicationmodel.dynamicdependency.bootstrap.initialize.md Demonstrates how to use the Initialize function to set up the Windows App SDK framework package. Includes error handling for initialization failures. ```cpp #include #include #include #include #include namespace MddBootstrap {using namespace \ ::Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap; } int main() { try { auto mddBootstrapCleanup{ MddBootstrap::Initialize() }; // Do work here. } catch (const winrt::hresult_error& ex) { const auto hr{ ex.code() }; std::cout << "Error 0x" << std::hex << hr << " in Bootstraper initialization"; return hr; } return 0; } ``` -------------------------------- ### MainPage Initialization and Setup Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/audio-video-camera/screen-capture.md Initializes the UI components and sets up the necessary graphics objects for screen capture, including CanvasDevice and CompositionGraphicsDevice. ```vbnet Partial Public NotInheritable Class MainPage Inherits Page ' Capture API objects. WithEvents CaptureItem As GraphicsCaptureItem WithEvents FramePool As Direct3D11CaptureFramePool Private _lastSize As SizeInt32 Private _session As GraphicsCaptureSession ' Non-API related members. Private _canvasDevice As CanvasDevice Private _compositionGraphicsDevice As CompositionGraphicsDevice Private _compositor As Compositor Private _surface As CompositionDrawingSurface Sub New() InitializeComponent() Setup() End Sub Private Sub Setup() _canvasDevice = New CanvasDevice() _compositionGraphicsDevice = CanvasComposition.CreateCompositionGraphicsDevice(Window.Current.Compositor, _canvasDevice) _compositor = Window.Current.Compositor ``` -------------------------------- ### Get Installed Devices Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/debug-test-perf/device-portal-api-core.md Retrieves a list of all devices installed on the machine. ```APIDOC ## GET /api/devicemanager/devices ### Description Retrieves a list of devices installed on the machine. ### Method GET ### Endpoint /api/devicemanager/devices ### Response #### Success Response (200) - **DeviceList** (array) - An array of installed device objects. - **Class** (string) - The device class. - **Description** (string) - A description of the device. - **ID** (string) - The unique identifier for the device. - **Manufacturer** (string) - The manufacturer of the device. - **ParentID** (string) - The ID of the parent device. - **ProblemCode** (int) - The problem code associated with the device. - **StatusCode** (int) - The status code of the device. ### Response Example ```json { "DeviceList": [ { "Class": "USB", "Description": "Example Device", "ID": "DeviceID", "Manufacturer": "Example Manufacturer", "ParentID": "ParentDeviceID", "ProblemCode": 0, "StatusCode": 0 } ] } ``` ``` -------------------------------- ### Example of a startup task in Package.appxmanifest Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/desktop/modernize/desktop-to-uwp-extensions.md This example demonstrates how to define a startup task in your application's manifest, including its ID, enabled state, and display name. ```XML ``` -------------------------------- ### Get installed apps Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/debug-test-perf/device-portal-api-core.md Retrieves a list of all applications installed on the system. ```APIDOC ## GET /api/app/packagemanager/packages ### Description Gets a list of apps installed on the system. ### Method GET ### Endpoint /api/app/packagemanager/packages ### Parameters #### Path Parameters - None #### Query Parameters - None ### Response #### Success Response (200) The response includes a list of installed packages with associated details. ```json { "InstalledPackages": [ { "Name": string, "PackageFamilyName": string, "PackageFullName": string, "PackageOrigin": int, "PackageRelativeId": string, "Publisher": string, "Version": { "Build": int, "Major": int, "Minor": int, "Revision": int }, "RegisteredUsers": [ { "UserDisplayName": string, "UserSID": string },... ] },... ] } ``` #### Error Response (4XX) Error codes. #### Error Response (5XX) Error codes. ``` -------------------------------- ### Create Project Directory and Navigate Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/dev-environment/javascript/vue-on-wsl.md Sets up a dedicated directory for your projects within the WSL filesystem and navigates into it. Storing projects here is crucial for optimal performance. ```bash mkdir -p ~/projects cd ~/projects ``` -------------------------------- ### Get queued install items and build initial store UI Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/packaging/self-install-package-updates.md This C# code example demonstrates how to retrieve a list of in-progress package updates for the current app using GetAssociatedStoreQueueItemsAsync. It iterates through the queue items, checks their installation state, and calls placeholder UI methods to reflect the status. This is useful for resuming or displaying the status of downloads when the app is relaunched. ```csharp private StoreContext context = null; private async Task GetQueuedInstallItemsAndBuildInitialStoreUI() { if (context == null) { context = StoreContext.GetDefault(); } // Get the Store packages in the install queue. IReadOnlyList storeUpdateItems = await context.GetAssociatedStoreQueueItemsAsync(); foreach (StoreQueueItem storeItem in storeUpdateItems) { // In this example we only care about package updates. if (storeItem.InstallKind != StoreQueueItemKind.Update) continue; StoreQueueItemStatus currentStatus = storeItem.GetCurrentStatus(); StoreQueueItemState installState = currentStatus.PackageInstallState; StoreQueueItemExtendedState extendedInstallState = currentStatus.PackageInstallExtendedState; // Handle the StatusChanged event to display current status to the customer. storeItem.StatusChanged += StoreItem_StatusChanged; switch (installState) { // Download and install are still in progress, so update the status for this // item and provide the extended state info. The following methods are not // implemented in this example; you should implement them as needed for your // app's UI. case StoreQueueItemState.Active: MarkUpdateInProgressInUI(storeItem, extendedInstallState); break; case StoreQueueItemState.Canceled: RemoveItemFromUI(storeItem); break; case StoreQueueItemState.Completed: MarkInstallCompleteInUI(storeItem); break; case StoreQueueItemState.Error: MarkInstallErrorInUI(storeItem); break; case StoreQueueItemState.Paused: MarkInstallPausedInUI(storeItem, installState, extendedInstallState); break; } } } private void StoreItem_StatusChanged(StoreQueueItem sender, object args) { StoreQueueItemStatus currentStatus = sender.GetCurrentStatus(); StoreQueueItemState installState = currentStatus.PackageInstallState; StoreQueueItemExtendedState extendedInstallState = currentStatus.PackageInstallExtendedState; switch (installState) { // Download and install are still in progress, so update the status for this // item and provide the extended state info. The following methods are not // implemented in this example; you should implement them as needed for your // app's UI. case StoreQueueItemState.Active: MarkUpdateInProgressInUI(sender, extendedInstallState); break; case StoreQueueItemState.Canceled: RemoveItemFromUI(sender); break; case StoreQueueItemState.Completed: ``` -------------------------------- ### Install MSIX package Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/dev-tools/winapp-cli/guides/electron-packaging.md Installs the generated MSIX package onto your system. After installation, the app should be available in the Start Menu. ```powershell Add-AppxPackage .\my-windows-app.msix ``` -------------------------------- ### Register User with Windows Hello Key Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/develop/security/windows-hello.md This comprehensive example demonstrates the full user registration process, including checking for Windows Hello support, creating a key pair, retrieving the public key, and obtaining attestation information. It's intended for backend registration services. ```csharp using System; using System.Runtime; using System.Threading.Tasks; using Windows.Storage.Streams; using Windows.Security.Credentials; static async void RegisterUser(string AccountId) { var keyCredentialAvailable = await KeyCredentialManager.IsSupportedAsync(); if (!keyCredentialAvailable) { // The user didn't set up a PIN yet return; } var keyCreationResult = await KeyCredentialManager.RequestCreateAsync(AccountId, KeyCredentialCreationOption.ReplaceExisting); if (keyCreationResult.Status == KeyCredentialStatus.Success) { var userKey = keyCreationResult.Credential; var publicKey = userKey.RetrievePublicKey(); var keyAttestationResult = await userKey.GetAttestationAsync(); IBuffer keyAttestation = null; IBuffer certificateChain = null; bool keyAttestationIncluded = false; bool keyAttestationCanBeRetrievedLater = false; ``` -------------------------------- ### Get basic install data for an application Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/monetize/get-app-installs.md This GET request retrieves the total number of successful installs for a given application ID. Ensure you include your access token in the Authorization header. ```syntax GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/installs?applicationId=9WZDNCRFJB4P HTTP/1.1 Authorization: Bearer ``` -------------------------------- ### Complete Package Manifest Example Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/desktop/modernize/desktop-to-uwp-extensions.md A full package manifest example demonstrating the registration of both a COM server and a file explorer context menu extension. ```xml ``` -------------------------------- ### Create a Local Settings Container Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/develop/data/store-and-retrieve-app-data.md Creates a local settings container named 'exampleContainer' if it doesn't already exist. Adds a setting 'exampleSetting' with the value 'Hello Windows'. ```csharp Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; Windows.Storage.StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; // Setting in a container Windows.Storage.ApplicationDataContainer container = localSettings.CreateContainer("exampleContainer", Windows.Storage.ApplicationDataCreateDisposition.Always); if (localSettings.Containers.ContainsKey("exampleContainer")) { localSettings.Containers["exampleContainer"].Values["exampleSetting"] = "Hello Windows"; } ``` -------------------------------- ### Get app installation status Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/debug-test-perf/device-portal-api-core.md Retrieves the status of an app installation that is currently in progress. ```APIDOC ## GET /api/app/packagemanager/state ### Description Gets the status of an app installation that is currently in progress. ### Method GET ### Endpoint /api/app/packagemanager/state ### Parameters #### Path Parameters - None #### Query Parameters - None ### Response #### Success Response (200) The result of the last deployment. #### Success Response (204) The installation is running. #### Error Response (404) No installation action was found. ``` -------------------------------- ### Example Context Settings Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/app-resources/how-rms-matches-and-chooses-resources.md These are the current application context settings used for resource matching. ```console Application language: en-US; fr-FR; Scale: 400 Contrast: Standard ``` -------------------------------- ### Get an app submission Request Example Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/monetize/get-an-app-submission.md This example shows how to make a GET request to retrieve an app submission. Ensure you replace placeholders with your actual access token, application ID, and submission ID. ```http GET https://manage.devcenter.microsoft.com/v1.0/my/applications/9NBLGGH4R315/submissions/1152921504621243680 HTTP/1.1 Authorization: Bearer ``` -------------------------------- ### Discover Host Example Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/develop/launch/launch-snipping-tool.md This example shows how to query the Snipping Tool's supported capabilities, modes, and protocol version at runtime. It includes user-agent and redirect-uri parameters. ```url ms-screenclip://discover?user-agent=MyApp&redirect-uri=my-app://response ``` -------------------------------- ### Initialize PWA for Microsoft Store Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/publish/msstore-dev-cli/commands.md Use the 'init' command to set up your PWA for publishing to the Microsoft Store. Provide the public URL and an output directory. ```console msstore init https://contoso.com --output . ``` -------------------------------- ### Initialize and Start Camera Preview Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/develop/camera/camera-quickstart-winui3.md Call this method when the user clicks the start preview button. It attempts to create a MediaFrameSource for video and begins rendering the stream. ```csharp private async Task StartPreviewAsync() { var captureInitSettings = new MediaCaptureInitializationSettings { StreamingCaptureMode = StreamingCaptureMode.Video }; _mediaCapture = new MediaCapture(); await _mediaCapture.InitializeAsync(captureInitSettings); var frameSource = _mediaCapture.FrameSources.FirstOrDefault(s => s.Value.Info.SourceKind == MediaFrameSourceKind.Color && s.Value.Info.HasProperties && s.Value.Info.Properties.ContainsKey(MediaFrameSourceInfo.VideoDeviceCharacteristicKey) && (VideoDeviceCharacteristic)s.Value.Info.Properties[MediaFrameSourceInfo.VideoDeviceCharacteristicKey] == VideoDeviceCharacteristic.All && s.Value.Info.MediaStreamType == MediaStreamType.VideoPreview); if (frameSource.Value == null) { frameSource = _mediaCapture.FrameSources.FirstOrDefault(s => s.Value.Info.SourceKind == MediaFrameSourceKind.Color && s.Value.Info.HasProperties && s.Value.Info.Properties.ContainsKey(MediaFrameSourceInfo.VideoDeviceCharacteristicKey) && (VideoDeviceCharacteristic)s.Value.Info.Properties[MediaFrameSourceInfo.VideoDeviceCharacteristicKey] == VideoDeviceCharacteristic.All && s.Value.Info.MediaStreamType == MediaStreamType.VideoRecord); } if (frameSource.Value != null) { var mediaPlayer = new MediaPlayer(); mediaPlayer.Source = MediaSource.CreateFromMediaFrameSource(frameSource.Value); _mediaPlayerElement.SetMediaPlayer(mediaPlayer); await mediaPlayer.PlayAsync(); } } ``` -------------------------------- ### Install development certificate Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/dev-tools/winapp-cli/guides/electron-packaging.md Installs a development certificate on your system. This is a one-time setup and requires administrator privileges. ```bash npx winapp cert install .\devcert.pfx ``` -------------------------------- ### Example: Enable and Configure FancyZones Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/powertoys/dsc-configure/psdsc.md This YAML configuration snippet demonstrates how to enable FancyZones and configure specific behaviors like snapping hotkeys and mouse-based zone switching. ```yaml properties: resources: - resource: Microsoft.PowerToys.Configure/PowerToysConfigure directives: description: Configure FancyZones settings: FancyZones: Enabled: true FancyzonesShiftDrag: true FancyzonesMouseSwitch: false FancyzonesOverrideSnapHotkeys: true FancyzonesEditorHotkey: "Win+Shift+`" configurationVersion: 0.2.0 ``` -------------------------------- ### Get app installs Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/monetize/get-app-installs.md Retrieves aggregate install data for an application. You can filter this data by date range and other optional parameters. ```APIDOC ## GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/installs ### Description Retrieves aggregate install data for an application in JSON format for a given date range and other optional filters. ### Method GET ### Endpoint https://manage.devcenter.microsoft.com/v1.0/my/analytics/installs ### Request Header - **Authorization** (string) - Required. The Azure AD access token in the format **Bearer** <*token*>. ``` -------------------------------- ### Get app's installed directory Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/develop/files/file-access-permissions.md Retrieve a StorageFolder representing the app's install directory. This location is read-only. ```csharp Windows.Storage.StorageFolder installedLocation = Windows.ApplicationModel.Package.Current.InstalledLocation; ``` ```cppwinrt #include ... Windows::Storage::StorageFolder installedLocation{ Windows::ApplicationModel::Package::Current().InstalledLocation() }; ``` -------------------------------- ### Open Store PDP and Install Product Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/monetize/send-requests-to-the-store.md Use this JSON payload to open a product's page in the Store, initiate its installation, and automatically open it once installation is complete. This requires the `productId` and setting `autoInstall` and `autoOpenOnInstallComplete` to true. The product will not open if it's already installed. ```json { "storeAction": 1, "productId": "9PB2MZ1ZMB1S", "autoInstall": true, "autoOpenOnInstallComplete": true } ``` -------------------------------- ### Get Installed Apps Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/debug-test-perf/device-portal-api-core.md Retrieve a list of all installed applications on the device. The response includes details such as Name, PackageFamilyName, and PackageFullName for each app. ```JSON { "InstalledPackages": [ { "Name": string, "PackageFamilyName": string, "PackageFullName": string, "PackageOrigin": int, (https://msdn.microsoft.com/library/windows/desktop/dn313167(v=vs.85).aspx) "PackageRelativeId": string, "Publisher": string, "Version": { "Build": int, "Major": int, "Minor": int, "Revision": int }, "RegisteredUsers": [ { "UserDisplayName": string, "UserSID": string },... ] },... ] } ``` -------------------------------- ### Initialize UWP App for Microsoft Store Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/publish/msstore-dev-cli/commands.md Use the 'init' command to set up your UWP application for publishing to the Microsoft Store. Specify the root directory of your project. ```console msstore init "C:\path\to\uwp_app" ``` -------------------------------- ### Get stack trace request example Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/monetize/get-the-stack-trace-for-an-error-in-your-app.md This example shows how to make a GET request to the analytics API to retrieve a stack trace for a specific application and CAB file ID. Ensure you replace the placeholder values with your actual application ID and access token. ```syntax GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/stacktrace?applicationId=9NBLGGGZ5QDR&cabId=1336373323853 HTTP/1.1 Authorization: Bearer ``` -------------------------------- ### Run a WinGet Configuration File Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/package-manager/winget/configure.md Initiates the setup of your development environment using a specified WinGet configuration file. Ensure the file is trusted before running. ```bash winget configure -f /winget-configs/config-file-name.dsc.winget> ``` -------------------------------- ### SystemUpdateStartInstallAction Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/whats-new/windows-10-build-17763-api-diff.md Defines actions that can be taken when starting an update installation. ```APIDOC ## Enum: SystemUpdateStartInstallAction ### Description Defines actions that can be taken when starting an update installation. ``` -------------------------------- ### Basic ListView Setup Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/develop/ui/controls/item-containers-templates.md Initial setup for a ListView without any specific item template. ```xaml ``` -------------------------------- ### Install MongoDB on Ubuntu WSL Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/includes/install-and-run-mongo.md Update Ubuntu packages and install MongoDB. This is the initial setup step for using MongoDB in your WSL environment. ```bash sudo apt update ``` ```bash sudo apt-get install mongodb ``` -------------------------------- ### Desktop App Migration Example in Package Manifest Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/desktop/modernize/desktop-to-uwp-extensions.md This example shows how to include the DesktopAppMigration extension within the package manifest to migrate shortcuts. ```XML       ``` -------------------------------- ### Get detailed install data with filtering and grouping Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/monetize/get-app-installs.md This GET request retrieves detailed install data, allowing you to specify date ranges, aggregation levels, and group results by various dimensions. Use the 'top' and 'skip' parameters for pagination and 'orderby' to sort the results. ```syntax GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/installs?applicationId=9NBLGGGZ5QDR&aggregationLevel=day&startDate=06/19/2022&endDate=07/21/2022&top=10&skip=0&groupby=applicationName,date,deviceType,market,osVersion,packageVersion&orderby=date desc HTTP/1.1 Authorization: Bearer ``` -------------------------------- ### Example Mapping File Content Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/app-resources/makepri-exe-command-options.md Provides examples of the content for main and resource pack mapping files. ```console "ResourceDimensions" "language-de-de" ``` ```console "ResourceId" "Resources184.la5decaf08" "ResourceDimensions" "language-de-de" ``` -------------------------------- ### Initialize with Experimental Packages Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/dev-tools/winapp-cli/usage.md Initialize the current directory for development using experimental SDK packages. ```bash winapp init --setup-sdks experimental ``` -------------------------------- ### Assign GUID to C# Interface Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/winrt-components/raising-events-in-windows-runtime-components.md Assign a unique GUID to an interface definition in C# to enable proper proxy generation for Windows Runtime components. Ensure you use a newly generated GUID, not the example. ```csharp [Guid("FC198F74-A808-4E2A-9255-264746965B9F")] public interface IToaster... ``` -------------------------------- ### Main program and imports for Store Services Examples Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/monetize/java-code-examples-for-the-windows-store-submission-api.md This snippet includes the import statements and the main program structure for the Store Services Java examples. It serves as the entry point and orchestrates calls to other example methods. ```java import java.io.IOException; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import javax.json.Json; import javax.json.JsonObject; import javax.json.JsonObjectBuilder; import org.apache.http.HttpException; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import com.microsoft.store.partnercenter.models.ResourceCollection; import com.microsoft.store.partnercenter.models.audits.AuditTargetType; import com.microsoft.store.partnercenter.models.audits.AuditTrail; import com.microsoft.store.partnercenter.models.applications.Application; import com.microsoft.store.partnercenter.models.applications.ApplicationType; import com.microsoft.store.partnercenter.models.applications.DevicePlatform; import com.microsoft.store.partnercenter.models.products.Availability; import com.microsoft.store.partnercenter.models.products.AvailabilityStatus; import com.microsoft.store.partnercenter.models.products.DeviceFamily; import com.microsoft.store.partnercenter.models.products.DeviceOsVersion; import com.microsoft.store.partnercenter.models.products.DeviceOsVersionType; import com.microsoft.store.partnercenter.models.products.DeviceType; import com.microsoft.store.partnercenter.models.products.HardwareVariant; import com.microsoft.store.partnercenter.models.products.HardwareVariantType; import com.microsoft.store.partnercenter.models.products.Image; import com.microsoft.store.partnercenter.models.products.ImageFileType; import com.microsoft.store.partnercenter.models.products.ImagePurpose; import com.microsoft.store.partnercenter.models.products.ListingContact; import com.microsoft.store.partnercenter.models.products.ListingType; import com.microsoft.store.partnercenter.models.products.MarketplaceCategory; import com.microsoft.store.partnercenter.models.products.PriceAndAvailability; import com.microsoft.store.partnercenter.models.products.PriceAndAvailabilityType; import com.microsoft.store.partnercenter.models.products.Product; import com.microsoft.store.partnercenter.models.products.ProductType; import com.microsoft.store.partnercenter.models.products.Sku; import com.microsoft.store.partnercenter.models.products.SkuType; import com.microsoft.store.partnercenter.models.products.TargetDevice; import com.microsoft.store.partnercenter.models.products.TargetDeviceType; import com.microsoft.store.partnercenter.models.products.WindowsAppType; import com.microsoft.store.partnercenter.models.submissions.PackageFile; import com.microsoft.store.partnercenter.models.submissions.PackageFileStatus; import com.microsoft.store.partnercenter.models.submissions.Submission; import com.microsoft.store.partnercenter.models.submissions.SubmissionStatus; import com.microsoft.store.partnercenter.models.submissions.SubmissionType; import com.microsoft.store.partnercenter.models.submissions.UpdateStatus; /** * Main class for Store Services examples. */ public class MainExample { private static String accessToken = "YOUR_ACCESS_TOKEN"; // Replace with your actual access token public static void main(String[] args) { try { // Example: Get an Azure AD access token // accessToken = getAccessToken(); // Example: Create an app submission // createApplicationSubmission(); // Example: Create an add-on submission // createAddonSubmission(); // Example: Create a package flight submission // createPackageFlightSubmission(); // Example: Create an add-on // createAddon(); // Example: Create a package flight // createPackageFlight(); } catch (Exception ex) { System.out.println("An error occurred: " + ex.getMessage()); ex.printStackTrace(); } } // Placeholder for getAccessToken method private static String getAccessToken() throws HttpException, IOException, URISyntaxException { // Implementation would go here return "YOUR_ACCESS_TOKEN"; } // Placeholder for createApplicationSubmission method private static void createApplicationSubmission() throws HttpException, IOException, URISyntaxException { // Implementation would go here System.out.println("Executing createApplicationSubmission..."); } // Placeholder for createAddonSubmission method private static void createAddonSubmission() throws HttpException, IOException, URISyntaxException { // Implementation would go here System.out.println("Executing createAddonSubmission..."); } // Placeholder for createPackageFlightSubmission method private static void createPackageFlightSubmission() throws HttpException, IOException, URISyntaxException { // Implementation would go here System.out.println("Executing createPackageFlightSubmission..."); } // Placeholder for createAddon method private static void createAddon() throws HttpException, IOException, URISyntaxException { // Implementation would go here System.out.println("Executing createAddon..."); } // Placeholder for createPackageFlight method private static void createPackageFlight() throws HttpException, IOException, URISyntaxException { // Implementation would go here System.out.println("Executing createPackageFlight..."); } } ``` -------------------------------- ### Get paths to installed Windows SDK components Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/dev-tools/winapp-cli/usage.md This command retrieves the file paths for installed Windows SDK components, including the .winapp workspace directory, package installation directories, and header locations. ```bash winapp get-winapp-path [options] ``` -------------------------------- ### Example: Configure Multiple PowerToys Utilities Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/powertoys/dsc-configure/psdsc.md This configuration example shows how to set preferences for multiple PowerToys utilities including General Settings, ColorPicker, PowerRename, and Awake. ```yaml properties: resources: - resource: Microsoft.PowerToys.Configure/PowerToysConfigure directives: description: Configure multiple PowerToys utilities settings: GeneralSettings: Startup: true Theme: "dark" EnableWarningsElevatedApps: true ColorPicker: Enabled: true ActivationShortcut: "Win+Shift+C" CopiedColorRepresentation: "HEX" PowerRename: Enabled: true MRUEnabled: true MaxMRUSize: 10 Awake: Enabled: true Mode: "INDEFINITE" KeepDisplayOn: true configurationVersion: 0.2.0 ``` -------------------------------- ### Get or create a file - C++/WinRT Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/develop/files/create-read-write-files.md Create or get a StorageFile object for 'sample.txt' in the local folder using C++/WinRT. This example uses CreationCollisionOption::ReplaceExisting. ```cppwinrt // MainPage.h #include ... Windows::Foundation::IAsyncAction ExampleCoroutineAsync() { Windows::Storage::StorageFolder storageFolder{ Windows::Storage::ApplicationData::Current().LocalFolder() }; auto sampleFile{ co_await storageFolder.CreateFileAsync(L"sample.txt", Windows::Storage::CreationCollisionOption::ReplaceExisting) }; // Process sampleFile } ``` -------------------------------- ### Get insights data request example Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/monetize/get-insights-data-for-your-app.md This example demonstrates how to make a GET request to the insights endpoint. Replace placeholder values with your specific application ID, desired date range, and filter criteria. Ensure you include a valid Azure AD access token in the Authorization header. ```syntax GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/insights?applicationId=9NBLGGGZ5QDR&startDate=6/1/2018&endDate=6/15/2018&filter=dataType eq 'acquisition' or dataType eq 'health' HTTP/1.1 Authorization: Bearer ``` -------------------------------- ### Initialize .NET MAUI App for Microsoft Store Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/hub/apps/publish/msstore-dev-cli/commands.md Use the 'init' command to set up your .NET MAUI application for publishing to the Microsoft Store. Specify the root directory of your project. ```console msstore init "C:\path\to\maui_app" ``` -------------------------------- ### WinAppDeployCmd List Installed Apps Source: https://github.com/microsoftdocs/windows-dev-docs/blob/docs/uwp/packaging/install-universal-windows-apps-with-the-winappdeploycmd-tool.md View the list of UWP apps installed on a target device. Specify the device using either its IP address or GUID. ```CMD WinAppDeployCmd list -ip
``` ```CMD WinAppDeployCmd list -guid
```