Skip to content

Commit

Permalink
Merge pull request #18588 from unoplatform/dev/jela/clickonce-update
Browse files Browse the repository at this point in the history
Misc docs updates
  • Loading branch information
jeromelaban authored Oct 26, 2024
2 parents e160f6b + 0405756 commit 3a628b8
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 10 deletions.
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,26 @@ For a larger example and features demo:
* Dev loop:
* Develop on Windows first using Visual Studio
* [XAML Hot Reload](https://blogs.msdn.microsoft.com/visualstudio/2016/04/06/ui-development-made-easier-with-xaml-edit-continue/) for live XAML edition on each keystroke
* [C# Hot Reload](https://learn.microsoft.com/visualstudio/debugger/hot-reload) on Windows (VS2022), Linux and macOS (VS Code)
* [C# Hot Reload](https://learn.microsoft.com/visualstudio/debugger/hot-reload) on Windows (VS2022/Rider/VS Code), Linux and macOS (VS Code / Rider)
* Validate on other platforms as late as possible
* Develop in VS Code, Codespaces, or GitPod
* Develop in VS Code, Rider, Codespaces, or GitPod
* XAML and/or C# Hot Reload for WebAssembly, Linux, iOS and Android
* [Uno.UITest](https://github.com/unoplatform/Uno.UITest), a library to create Cross-Platform UI Tests for WebAssembly, iOS, and Android.
* Cross Platform Controls:
* [Control Templating](https://learn.microsoft.com/windows/uwp/design/controls-and-patterns/control-templates)
* [Data Templating](https://code.msdn.microsoft.com/Data-Binding-in-UWP-b5c98114)
* [Styling](https://learn.microsoft.com/windows/uwp/design/controls-and-patterns/xaml-styles)
* [Rich Animations](https://learn.microsoft.com/windows/uwp/design/motion/xaml-animation)
* UWP/WinUI Code Support:
* WinUI/UWP Code Support:
* [Windows Community Toolkit](https://github.com/CommunityToolkit/Windows)
* [Windows Community Toolkit (Uno Fork)](https://github.com/unoplatform/uno.WindowsCommunityToolkit)
* [Community Toolkit MVVM](https://learn.microsoft.com/dotnet/communitytoolkit/mvvm/)
* [MVVM Light Toolkit](https://github.com/unoplatform/uno.mvvmlight)
* [Microsoft XAML Behaviors](https://github.com/unoplatform/uno.XamlBehaviors)
* [Prism](https://github.com/prismlibrary/prism)
* [SkiaSharp](https://github.com/mono/SkiaSharp)
* [SkiaSharp.Extended](https://github.com/mono/SkiaSharp.Extended)
* [ReactiveUI Official](https://github.com/reactiveui/ReactiveUI/pull/2067)
* [WindowsStateTriggers](https://github.com/unoplatform/uno.WindowsStateTriggers)
* [Xamarin.Forms for UWP](https://github.com/unoplatform/uno.Xamarin.Forms), [NuGet](https://www.nuget.org/packages/ReactiveUI.Uno)
* [Rx.NET](https://github.com/reactiveui/Reactive.Wasm)
* [ColorCode-Universal](https://github.com/unoplatform/uno.ColorCode-Universal)
* [LibVLCSharp](https://github.com/videolan/libvlcsharp)
Expand Down Expand Up @@ -92,14 +90,9 @@ Here's a list of live apps made with the Uno Platform for WebAssembly.
* The [Community Toolkit Labs App](https://toolkitlabs.dev/)
* [SkiaSharp fork for the Uno Platform](https://skiasharp-wasm.platform.uno/), Skia is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library ([Source](https://github.com/unoplatform/Uno.SkiaSharp)).
* The [Uno.WindowsCommunityToolkit](https://windowstoolkit-wasm.platform.uno/) ([Source](https://github.com/unoplatform/uno.WindowsCommunityToolkit)).
* The [Uno.Lottie](https://lottie.platform.uno/), a sample that uses the [AnimatedVisualPlayer](https://learn.microsoft.com/uwp/api/microsoft.ui.xaml.controls.animatedvisualplayer) ([Source](https://github.com/unoplatform/uno.LottieSample)).
* The [Uno.RoslynQuoter](https://roslynquoter-wasm.platform.uno/), a [Roslyn](https://github.com/dotnet/roslyn) based C# analysis tool ([Source](https://github.com/unoplatform/uno.RoslynQuoter)).
* The [Uno.BikeSharing360 App](http://bikerider-wasm.platform.uno/), a Xamarin.Forms app running on top of Uno for WebAssembly ([Source](https://github.com/unoplatform/uno.BikeSharing360_MobileApps)).
* The [Uno.WindowsStateTriggers App](http://winstatetriggers-wasm.platform.uno/), a demo of the [Morten's WindowsStateTriggers](https://github.com/dotMorten/WindowsStateTriggers) ([Source](https://github.com/unoplatform/uno.WindowsStateTriggers)).
* The [SQLite + Entity Framework Core App](https://sqliteefcore-wasm.platform.uno), a demo of the combination of [Roslyn](https://github.com/dotnet/roslyn), [Entity Framework Core](https://learn.microsoft.com/ef/core/), [SQLite](https://github.com/unoplatform/uno.SQLitePCLRaw.Wasm) and the Uno Platform to manipulate an in-browser database.
* The [Uno.WebSockets App](https://websockets-wasm.platform.uno), a demo of System.Net.WebSocket running from WebAssembly ([Source](https://github.com/unoplatform/uno.Wasm.WebSockets)).
* A [WebAssembly AOT RayTracer](https://raytracer-mono-aot.platform.uno/).
* The [Xaml Controls Gallery](https://xamlcontrolsgallery.platform.uno/) ([Source](https://github.com/unoplatform/uno.Xaml-Controls-Gallery)).

Let us know if you've made your app publicly available, we'll list it here!

Expand Down
8 changes: 8 additions & 0 deletions doc/articles/uno-build-error-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ The project doesn't know how to run the profile with name 'MyApp (Desktop WSL2)'

To fix the issue, reorder the items in your `.csproj` so that `TargetFrameworks` contains `netX.0-desktop` as the first target framework.

The Uno Platform team is following this [Visual Studio issue](https://developercommunity.visualstudio.com/t/WSL-launch-profile-cannot-be-found-when/10776961).

### UNOB0016: The Publish Profile file must not contain the "PublishDir"

When publishing an app using ClickOnce on Windows, the `PublishProfile` file may not contain a `PublishDir` entry if the command line parameter `UnoClickOncePublishDir` has been set.

This situation is due to an MSBuild property overriding bug found in the .NET SDK. For more information, see our [publishing with ClickOnce](xref:uno.publishing.desktop#windows-clickonce) documentation.

## Compiler Errors

### UNO0001
Expand Down
94 changes: 94 additions & 0 deletions doc/articles/uno-publishing-desktop.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
uid: uno.publishing.desktop
---

<!-- markdownlint-disable MD001 MD051 -->

# Publishing Your App For Desktop

## Preparing For Publish
Expand Down Expand Up @@ -43,6 +45,98 @@ dotnet publish -f net8.0-desktop -r {{RID}} -p:SelfContained=true

Where `{{RID}}` specifies the chosen OS and Architecture (e.g. win-x64). When targeting Windows, cross-publishing to architectures other than the currently running one is not supported.

### Windows ClickOnce

Uno Platform supports publishing desktop apps using ClickOnce to Windows environments.

In order to do so, you'll need to create a `.pubxml` file using Visual Studio, or to use the file below:

# [**Using a Sample Profile**](#tab/windows)

Create a file named `Properties\PublishProfiles\ClickOnceProfile.pubxml` in your project with the following contents:

```xml
<?xml version="1.0" encoding="utf-8"?>
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
<Project>
<PropertyGroup>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.*</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Release</Configuration>
<CreateWebPageOnPublish>False</CreateWebPageOnPublish>
<GenerateManifests>true</GenerateManifests>
<Install>True</Install>
<InstallFrom>Disk</InstallFrom>
<IsRevisionIncremented>True</IsRevisionIncremented>
<IsWebBootstrapper>False</IsWebBootstrapper>
<MapFileExtensions>True</MapFileExtensions>
<OpenBrowserOnPublish>False</OpenBrowserOnPublish>
<Platform>x64</Platform>
<PublishProtocol>ClickOnce</PublishProtocol>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishSingleFile>False</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>True</SelfContained>
<SignatureAlgorithm>(none)</SignatureAlgorithm>
<SignManifests>False</SignManifests>
<SkipPublishVerification>false</SkipPublishVerification>
<TargetFramework>net8.0-desktop</TargetFramework>
<UpdateEnabled>False</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateRequired>False</UpdateRequired>
<WebPageFileName>Publish.html</WebPageFileName>

<!-- Those two lines below need to be removed when building using "UnoClickOncePublishDir" -->
<PublishDir>bin\Release\net8.0-desktop\win-x64\app.publish\</PublishDir>
<PublishUrl>bin\publish\</PublishUrl>
</PropertyGroup>
<ItemGroup>
<!-- This section needs to be adjusted based on the target framework -->
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.8.0.x64">
<Install>true</Install>
<ProductName>.NET Desktop Runtime 8.0.10 (x64)</ProductName>
</BootstrapperPackage>
</ItemGroup>
</Project>
```

# [**Using the Wizard**](#tab/vs-wizard)

> [!NOTE]
> An existing Visual Studio issue prevents the **Publish** context menu from being active
> if iOS/Android/maccatalyst are present in the TargetFrameworks list. In order to create
> the file, you can temporarily remove those target frameworks from `TargetFrameworks` in
> order to create the `.pubxml` file generated.
To use the Visual Studio publishing wizard:

- Select the `netX.0-desktop` target framework in the debugger drop-down
- In the Solution Explorer, right click on your project then select **Publish**
- Click the **+ New profile** button
- Select **ClickOnce**, then **Next**
- Configure your app publishing in all the following wizard pages
- In the **Configuration** section, make sure to select **Portable** for the **Target runtime**
- Click **Finish**.

The `Properties\PublishProfiles\ClickOnceProfile.pubxml` file will be created.

***

Once done, you can use the following command in your CI environment, or using a **Developer Command Prompt for Visual Studio**:

```shell
msbuild /m /r /target:Publish /p:Configuration=Release /p:PublishProfile="Properties\PublishProfiles\ClickOnceProfile.pubxml" /p:TargetFramework=net8.0-desktop
```

The resulting package will be located in the `bin\publish` folder. You can change the output folder using `/p:UnoClickOncePublishDir=your\output\directory`.

Depending on your deployment settings, you can run the `Setup.exe` file to install the application on a machine.

> [!IMPORTANT]
> At this time, publishing with the Visual Studio Publishing Wizard is not supported for
> multi-targeted projects. Using the command line above is required.
### macOS App Bundles

We now support generating `.app` bundles on macOS machines. From the CLI run:
Expand Down

0 comments on commit 3a628b8

Please sign in to comment.