-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added `Compiler.PreferredComponentGuidConsistency` to allow consistent generation of the component GUIDs between all versions of the same product. - Fixed ExitDialog (form) layout problem - Fix error WIX0400: The ProgressText element contains illegal inner text when setting CustomAction ProgressText or RollbackProgressText
- Loading branch information
1 parent
787bcd8
commit 0ef08d8
Showing
14 changed files
with
170 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
.../Wix# Samples/Bootstrapper/WiX5-Spike/WixToolset.WixBA/output/net472/WixToolset.WixBA.exe
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...mples/Bootstrapper/WiX5-Spike/WixToolset.WixBA/output/net6.0-windows/WixToolset.WixBA.dll
Binary file not shown.
Binary file modified
BIN
+2.5 KB
(100%)
...mples/Bootstrapper/WiX5-Spike/WixToolset.WixBA/output/net6.0-windows/WixToolset.WixBA.exe
Binary file not shown.
156 changes: 131 additions & 25 deletions
156
Source/src/WixSharp.Samples/Wix# Samples/testpad/setup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,141 @@ | ||
//css_dir ..\..\; | ||
// //css_ref Wix_bin\WixToolset.Dtf.WindowsInstaller.dll; | ||
//css_ref D:\dev\Galos\wixsharp-wix4\Source\src\WixSharp.Samples\Wix# Samples\Install Files\bin\Debug\net472\WixToolset.Dtf.WindowsInstaller.dll | ||
//css_ref D:\dev\Galos\wixsharp-wix4\Source\src\WixSharp.Samples\Wix# Samples\Install Files\bin\Debug\net472\WixToolset.Mba.Core.dll | ||
|
||
//css_ref System.Core.dll; | ||
//css_ref System.Xml.dll; | ||
//using PirrosLibrary; | ||
using System; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Windows.Forms; | ||
using System.Xml.Linq; | ||
using System.Collections.Generic; | ||
using static System.Net.Mime.MediaTypeNames; | ||
using System.Security.Cryptography; | ||
using WixSharp; | ||
using WixSharp.CommonTasks; | ||
using WixSharp.UI; | ||
|
||
static class Script | ||
class Constants | ||
{ | ||
public static string PluginVersion = "2.3.0"; | ||
} | ||
|
||
namespace Pirros.installer.wixsharp | ||
{ | ||
static public void Main() | ||
class Program | ||
{ | ||
Feature poFeature = new Feature("PO", "PO", "INSTALLDIR"); | ||
#if DEBUG | ||
private static readonly string Configuration = "Debug"; | ||
#else | ||
private static readonly string Configuration = "Release"; | ||
#endif | ||
|
||
public static void Main() | ||
{ | ||
return; // REMOVE THIS LINE TO ENABLE BUILDING | ||
|
||
Environment.CurrentDirectory = @"D:\dev\support\wixsharp-issues\Pirros\WixSharp Setup1\WixSharp Setup1"; | ||
Constants.PluginVersion = "2.4.0"; | ||
|
||
string Version = Constants.PluginVersion; // READ FROM PIRROS LIBRARY | ||
Guid ProductId = GenerateProductId("Pirros" + Constants.PluginVersion); | ||
Guid UpgradeCode = new Guid("6476F6DF-EB27-4CAB-9790-5FE5F1C39731"); // DO NOT TOUCH | ||
|
||
Project project = | ||
new Project("Pirros", | ||
new Media { EmbedCab = true }, // copied from old installer, don't know what it does | ||
CreateRevitAddinDir(2020)// , | ||
// CreateRevitAddinDir(2021), | ||
// CreateRevitAddinDir(2022), | ||
// CreateRevitAddinDir(2023), | ||
// CreateRevitAddinDir(2024), | ||
// CreateRevitAddinDir(2025) | ||
); | ||
|
||
project.Scope = InstallScope.perUser; | ||
|
||
project.Name = "Pirros Revit Plugin"; | ||
project.ProductId = ProductId; | ||
project.UpgradeCode = UpgradeCode; | ||
//project.GUID = new Guid("6476F6DF-EB27-4CAB-9790-5FE5F1C39735"); | ||
|
||
project.Version = new Version(Version); | ||
project.Description = "Revit Plugin to interact with Pirros.com"; | ||
project.ControlPanelInfo.Manufacturer = "Pirros Inc"; | ||
project.ControlPanelInfo.ProductIcon = @".\Assets\icon.ico"; | ||
project.ControlPanelInfo.UrlInfoAbout = "https://www.pirros.com"; | ||
|
||
project.MajorUpgrade = new MajorUpgrade | ||
{ | ||
DowngradeErrorMessage = "A newer version of Pirros Plugin is already installed.", | ||
}; | ||
|
||
project.UI = WUI.WixUI_Minimal; | ||
|
||
var project = new ManagedProject("My Product", | ||
new Dir(@"%ProgramFiles%\My Company", | ||
new InstallDir("My Product", | ||
new Files(poFeature, @"C:\Builds\a\*.*"), | ||
new Files(poFeature, @"C:\Builds\b\*.*")))); | ||
project.WixVariables = new Dictionary<string, string> | ||
{ | ||
{ "WixUILicenseRtf", @".\Assets\License.rtf" }, | ||
{ "WixUIBannerBmp", @".\Assets\Banner.png" }, | ||
{ "WixUIDialogBmp", @".\Assets\Background.png" } | ||
}; | ||
|
||
project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); | ||
project.OutFileName = $"Pirros.installer-V{Version}{(Configuration == "Debug" ? "-dev" : "")}"; | ||
|
||
Compiler.EmitRelativePaths = false; | ||
project.SourceBaseDir = @"D:\dev\support\wixsharp-issues\Pirros\WixSharp Setup1\WixSharp Setup1"; | ||
|
||
//project.BuildMsi(); | ||
// Compiler.PreserveTempFiles = true; | ||
Compiler.EmitRelativePaths = false; | ||
Compiler.PreferredComponentGuidConsistency = ComponentGuidConsistency.WithinSingleVersion; | ||
// var ttt = WixGuid.NewGuid("text"); | ||
|
||
//WixGuid.ConsistentGenerationStartValue = UpgradeCode; | ||
|
||
project.BuildMsi(); | ||
} | ||
|
||
private static Dir CreateRevitAddinDir(int year) | ||
{ | ||
string framework = GetFrameworkForYear(year); | ||
|
||
return new Dir($@"%AppDataFolder%\Autodesk\Revit\Addins\{year}", | ||
new File(@"..\Pirros\Pirros.addin"), | ||
new Dir("Pirros", | ||
Files.FromBuildDir($@"..\Pirros\bin\{Configuration}{year}\{framework}"), | ||
new Dir("Resources", | ||
new Files(@"..\Pirros\Resources\*.*")))); | ||
} | ||
|
||
private static Guid GenerateProductId(string input) | ||
{ | ||
using (var sha256 = SHA256.Create()) | ||
{ | ||
byte[] hashBytes = sha256.ComputeHash(System.Text.Encoding.UTF8.GetBytes(input)); | ||
|
||
// Ensure the byte array is exactly 16 bytes long, as required for a GUID. | ||
// SHA256 generates 32 bytes, so we take the first 16 bytes. | ||
byte[] guidBytes = new byte[16]; | ||
Array.Copy(hashBytes, guidBytes, 16); | ||
|
||
// Construct the GUID from the 16-byte array. | ||
return new Guid(guidBytes); | ||
} | ||
} | ||
|
||
private static string GetFrameworkForYear(int year) | ||
{ | ||
return year < 2025 ? "net48" : "net8.0-windows"; | ||
} | ||
} | ||
} | ||
} | ||
|
||
//using System; | ||
//using WixSharp; | ||
|
||
//namespace WixSharp_Setup1 | ||
//{ | ||
// public class Program | ||
// { | ||
// static void Main() | ||
// { | ||
// var project = new Project("MyProduct", | ||
// new Dir(@"%ProgramFiles%\My Company\My Product", | ||
// new File("Program.cs"))); | ||
|
||
// project.GUID = new Guid("e4c1d973-9881-498f-8b24-b61bcaee05d0"); | ||
// //project.SourceBaseDir = "<input dir path>"; | ||
// //project.OutDir = "<output dir path>"; | ||
|
||
// project.BuildMsi(); | ||
// } | ||
// } | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters