mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Another fix for WiX and dashes in the package id (#59)
This commit is contained in:
@@ -381,10 +381,16 @@ namespace SquirrelCli
|
||||
var setupExeDir = Path.GetDirectoryName(setupExe);
|
||||
var setupName = Path.GetFileNameWithoutExtension(setupExe);
|
||||
var culture = CultureInfo.GetCultureInfo(package.Language ?? "").TextInfo.ANSICodePage;
|
||||
|
||||
var templateText = File.ReadAllText(HelperExe.WixTemplatePath);
|
||||
|
||||
// WiX Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or
|
||||
// periods(.). Every identifier must begin with either a letter or an underscore.
|
||||
var wixId = Regex.Replace(package.Id, @"[^\w\.]", "_");
|
||||
if (Char.GetUnicodeCategory(wixId[0]) == UnicodeCategory.DecimalDigitNumber)
|
||||
wixId = "_" + wixId;
|
||||
|
||||
var templateData = new Dictionary<string, string> {
|
||||
{ "Id", package.Id },
|
||||
{ "Id", wixId },
|
||||
{ "Title", package.ProductName },
|
||||
{ "Author", package.ProductCompany },
|
||||
{ "Version", package.Version.Version.ToString() },
|
||||
|
||||
Reference in New Issue
Block a user