Skip to content

Commit 00d5f54

Browse files
authored
Merge pull request #1359 from mhartvig/Codepage
Add support to override default Codepage
2 parents 9787421 + ca3d5a1 commit 00d5f54

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,4 @@ tests/Test.xml
181181
## CPP db crap
182182
*.db
183183
*.opendb
184+
.vs/

docs/using/nuget-package-metadata.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55

66
Squirrel uses information from your app's EXE as well as the NuGet package Metadata for the setup and uninstall UI.
77

8-
* **Id** - name of the application (**warning:** you must **[avoid using spaces and dots](https://github.com/Squirrel/Squirrel.Windows/issues/523)** in the Id).
9-
* Name of the release packages (e.g., **MyApp**-1.0.0-full.nupkg).
10-
* Local installation directory (e.g., `%LocalAppData%\MyApp`).
8+
* **Id** - name of the application (**warning:** you must **[avoid using spaces and dots](https://github.com/Squirrel/Squirrel.Windows/issues/523)** in the Id).
9+
* Name of the release packages (e.g., **MyApp**-1.0.0-full.nupkg).
10+
* Local installation directory (e.g., `%LocalAppData%\MyApp`).
1111
* **Title** - used for the name of the application in the Windows Application Uninstaller.
1212
* **Version** - version specified in `Properties\Assembly.cs`.
13-
* Name of the release package (e.g., MyApp-**1.0.0**-full.nupkg).
14-
* Version number in the Windows Uninstaller (see screenshot below).
15-
* **Icon Url** - url to an icon to be used for the application. Used for the shortcuts and Windows Uninstaller icons. This must be an icon file (*.ICO) to work correctly. Note that the icon is fetched at installation time rather than packaging (source: [issue #745](https://github.com/Squirrel/Squirrel.Windows/issues/745))
13+
* Name of the release package (e.g., MyApp-**1.0.0**-full.nupkg).
14+
* Version number in the Windows Uninstaller (see screenshot below).
15+
* **Icon Url** - url to an icon to be used for the application. Used for the shortcuts and Windows Uninstaller icons. This must be an icon file (*.ICO) to work correctly. Note that the icon is fetched at installation time rather than
16+
packaging (source: [issue #745](https://github.com/Squirrel/Squirrel.Windows/issues/745))
17+
* **Language** Changes the codepage in to support non english characters. Defaults to 1252 if not present.
1618

1719
![](images/uninstall-app.png)
1820

src/Update/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics;
4+
using System.Globalization;
45
using System.IO;
56
using System.IO.Compression;
67
using System.Linq;
@@ -725,13 +726,17 @@ static async Task createMsiPackage(string setupExe, IPackage package)
725726
var setupExeDir = Path.GetDirectoryName(setupExe);
726727
var company = String.Join(",", package.Authors);
727728

729+
var culture = CultureInfo.GetCultureInfo(package.Language ?? "").TextInfo.ANSICodePage;
730+
731+
728732
var templateText = File.ReadAllText(Path.Combine(pathToWix, "template.wxs"));
729733
var templateData = new Dictionary<string, string> {
730734
{ "Id", package.Id },
731735
{ "Title", package.Title },
732736
{ "Author", company },
733737
{ "Version", Regex.Replace(package.Version.ToString(), @"-.*$", "") },
734738
{ "Summary", package.Summary ?? package.Description ?? package.Id },
739+
{ "Codepage", $"{culture}" }
735740
};
736741

737742
// NB: We need some GUIDs that are based on the package ID, but unique (i.e.

vendor/wix/template.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
2-
<Product Id="*" Name="{{Title}} Machine-Wide Installer" Language="1033" Version="!(bind.FileVersion.{{Id}}.exe)" UpgradeCode="{{IdAsGuid1}}" Manufacturer="{{Author}}">
2+
<Product Id="*" Name="{{Title}} Machine-Wide Installer" Language="1033" Codepage="{{Codepage}}" Version="!(bind.FileVersion.{{Id}}.exe)" UpgradeCode="{{IdAsGuid1}}" Manufacturer="{{Author}}">
33

44
<Package Description="#Description" Comments="Comments" InstallerVersion="200" Compressed="yes"/>
55
<Media Id="1" Cabinet="contents.cab" EmbedCab="yes" CompressionLevel="high"/>

0 commit comments

Comments
 (0)