Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare PowerShell Module for Release Build #2768

Merged
merged 8 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<DocumentationFile>$(OutputPath)\Microsoft.WinGet.Client.xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(WingetUseProdClsids)' == 'true'">
<PropertyGroup Condition="'$(UseProdCLSIDs)' == 'true'">
<DefineConstants>USE_PROD_CLSIDS</DefineConstants>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,11 @@ PowerShellVersion = '5.1.0'
FormatsToProcess = 'Format.ps1xml'

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
NestedModules = if ($env:PROCESSOR_ARCHITECTURE -like 'AMD64' -OR $env:PROCESSOR_ARCHITECTURE -like 'IA64') {
"x64\$PSEdition\Microsoft.WinGet.Client.dll"
}
elseif ($env:PROCESSOR_ARCHITECTURE -like 'ARM64') {
"ARM64\$PSEdition\Microsoft.WinGet.Client.dll"
NestedModules = if ($env:PROCESSOR_ARCHITECTURE -like 'x86') {
"x86\$PSEdition\Microsoft.WinGet.Client.dll"
}
else {
"x86\$PSEdition\Microsoft.WinGet.Client.dll"
"x64\$PSEdition\Microsoft.WinGet.Client.dll"
}

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
Expand Down
12 changes: 10 additions & 2 deletions src/PowerShell/Microsoft.WinGet.Client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@

This project contains the source code for building the Windows Package Manager PowerShell Module.

## Running the PowerShell Module Locally
## Building the PowerShell Module Locally

After building the project solution, the `Microsoft.WinGet.Client` PowerShell module can be found in the output directory in the `PowerShell` folder. For example if you built the project as x64 release, you should expect to find the module files in `$(SolutionDirectory)/src/x64/Release/PowerShell`.

To run the module, make sure you are using the latest version of PowerShell (not Windows PowerShell), then import the module manifest (Microsoft.WinGet.Client.psd1).
## Quick Start Guide

**To run the module, make sure you are using the latest version of PowerShell (not Windows PowerShell)**.

```
winget install --id Microsoft.Powershell
```

Import the module manifest (Microsoft.WinGet.Client.psd1) by running the following command:

```
Import-Module <Path to Microsoft.WinGet.Client.psd1">
Expand Down
2 changes: 1 addition & 1 deletion src/WinGetServer/WinGetServerManualActivation_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <filesystem>
#include <shlobj_core.h>

#if USE_PROD_WINGET_SERVER
#ifdef USE_PROD_WINGET_SERVER
const std::wstring_view s_ServerExePath = L"Microsoft\\WindowsApps\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\WindowsPackageManagerServer.exe";
#else
const std::wstring_view s_ServerExePath = L"Microsoft\\WindowsApps\\WinGetDevCLI_8wekyb3d8bbwe\\WindowsPackageManagerServerDev.exe";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@
<ModuleDefinitionFile>winrtact.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(WingetEnableReleaseBuild)'=='true'">
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved
<ClCompile>
<PreprocessorDefinitions>USE_PROD_WINGET_SERVER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="cpp.hint" />
<None Include="packages.config" />
Expand Down