diff --git a/.gitignore b/.gitignore index d7c7919a2..a6505b95a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,5 +20,6 @@ _ReSharper*/ /ICSharpCode.Decompiler.Tests/TestCases/Correctness/*.exe.config /ICSharpCode.Decompiler/ICSharpCode.Decompiler.nuspec multitargeting.props -ILSpy.MsiBuilder/wix/*.g.wxs -ILSpy.MsiBuilder/output/ +ILSpy.Installer/wix/*.g.wxs +ILSpy.Installer/output/ +ILSpy.Installer/AppPackage.cs diff --git a/BuildTools/update-assemblyinfo.ps1 b/BuildTools/update-assemblyinfo.ps1 index 65eec9897..1c0e98324 100644 --- a/BuildTools/update-assemblyinfo.ps1 +++ b/BuildTools/update-assemblyinfo.ps1 @@ -76,7 +76,8 @@ $templateFiles = ( @{Input="ICSharpCode.Decompiler/ICSharpCode.Decompiler.nuspec.template"; Output="ICSharpCode.Decompiler/ICSharpCode.Decompiler.nuspec"}, @{Input="ILSpy/Properties/app.config.template"; Output = "ILSpy/app.config"}, @{Input="ILSpy.AddIn/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn/source.extension.vsixmanifest"}, - @{Input="ILSpy.AddIn.VS2022/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn.VS2022/source.extension.vsixmanifest"} + @{Input="ILSpy.AddIn.VS2022/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn.VS2022/source.extension.vsixmanifest"}, + @{Input="ILSpy.Installer/AppPackage.cs.template"; Output = "ILSpy.Installer/AppPackage.cs"} ); $appxmanifestFiles = ( diff --git a/ILSpy.MsiBuilder/App.config b/ILSpy.Installer/App.config similarity index 100% rename from ILSpy.MsiBuilder/App.config rename to ILSpy.Installer/App.config diff --git a/ILSpy.Installer/AppPackage.cs.template b/ILSpy.Installer/AppPackage.cs.template new file mode 100644 index 000000000..72ee86765 --- /dev/null +++ b/ILSpy.Installer/AppPackage.cs.template @@ -0,0 +1,9 @@ +using System; + +namespace ILSpy.Installer +{ + internal static class AppPackage + { + public static Version Version = new Version("$INSERTVERSION$"); + } +} \ No newline at end of file diff --git a/ILSpy.MsiBuilder/ILSpy.MsiBuilder.csproj b/ILSpy.Installer/ILSpy.Installer.csproj similarity index 94% rename from ILSpy.MsiBuilder/ILSpy.MsiBuilder.csproj rename to ILSpy.Installer/ILSpy.Installer.csproj index b6f72f5a3..89c67dc5d 100644 --- a/ILSpy.MsiBuilder/ILSpy.MsiBuilder.csproj +++ b/ILSpy.Installer/ILSpy.Installer.csproj @@ -6,8 +6,8 @@ AnyCPU {A4BA0771-DA4A-4A94-A5EC-5BA10B52816F} Exe - ILSpy.MsiBuilder - ILSpy.MsiBuilder + ILSpy.Installer + ILSpy.Installer v4.7.2 512 true @@ -35,6 +35,9 @@ prompt 4 + + ILSpy.Installer.Builder + ..\packages\WixSharp.bin.1.19.0\lib\BootstrapperCore.dll @@ -61,6 +64,8 @@ + + diff --git a/ILSpy.MsiBuilder/Properties/AssemblyInfo.cs b/ILSpy.Installer/Properties/AssemblyInfo.cs similarity index 100% rename from ILSpy.MsiBuilder/Properties/AssemblyInfo.cs rename to ILSpy.Installer/Properties/AssemblyInfo.cs diff --git a/ILSpy.MsiBuilder/packages.config b/ILSpy.Installer/packages.config similarity index 100% rename from ILSpy.MsiBuilder/packages.config rename to ILSpy.Installer/packages.config diff --git a/ILSpy.MsiBuilder/setup.cs b/ILSpy.Installer/setup.cs similarity index 70% rename from ILSpy.MsiBuilder/setup.cs rename to ILSpy.Installer/setup.cs index 2af841913..6c528caad 100644 --- a/ILSpy.MsiBuilder/setup.cs +++ b/ILSpy.Installer/setup.cs @@ -3,9 +3,9 @@ using System.IO; using WixSharp; -namespace ILSpy.MsiBuilder +namespace ILSpy.Installer { - internal class MsiBuilder + internal class Builder { static public void Main() { @@ -20,12 +20,18 @@ namespace ILSpy.MsiBuilder new Files(@"ILSpy\bin\Release\net472\ILSpy.ReadyToRun.Plugin.resources.dll"))); project.GUID = new Guid("a12fdab1-731b-4a98-9749-d481ce8692ab"); - project.Version = new Version("1.0.0.0"); + project.Version = AppPackage.Version; project.SourceBaseDir = Path.GetDirectoryName(Environment.CurrentDirectory); project.InstallScope = InstallScope.perUser; project.InstallPrivileges = InstallPrivileges.limited; - project.UI = WUI.WixUI_Minimal; + project.MajorUpgrade = new MajorUpgrade { + Schedule = UpgradeSchedule.afterInstallInitialize, + AllowSameVersionUpgrades = true, + DowngradeErrorMessage = "A newer release of ILSpy is already installed on this system. Please uninstall it first to continue." + }; + + project.UI = WUI.WixUI_ProgressOnly; Compiler.BuildMsi(project, Path.Combine(Environment.CurrentDirectory, "output", "ILSpy.msi")); } diff --git a/ILSpy.sln b/ILSpy.sln index 54796ff2a..8ba170f25 100644 --- a/ILSpy.sln +++ b/ILSpy.sln @@ -47,6 +47,13 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ILSpy.AddIn.Shared", "ILSpy EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.AddIn.VS2022", "ILSpy.AddIn.VS2022\ILSpy.AddIn.VS2022.csproj", "{09A03980-D14A-4705-A38C-741AD7166DEE}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILSpy.Installer", "ILSpy.Installer\ILSpy.Installer.csproj", "{A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}" + ProjectSection(ProjectDependencies) = postProject + {0313F581-C63B-43BB-AA9B-07615DABD8A3} = {0313F581-C63B-43BB-AA9B-07615DABD8A3} + {A6BAD2BA-76BA-461C-8B6D-418607591247} = {A6BAD2BA-76BA-461C-8B6D-418607591247} + {1E85EFF9-E370-4683-83E4-8A3D063FF791} = {1E85EFF9-E370-4683-83E4-8A3D063FF791} + EndProjectSection +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution ILSpy.AddIn.Shared\ILSpy.AddIn.Shared.projitems*{09a03980-d14a-4705-a38c-741ad7166dee}*SharedItemsImports = 5 @@ -114,6 +121,10 @@ Global {09A03980-D14A-4705-A38C-741AD7166DEE}.Debug|Any CPU.Build.0 = Debug|Any CPU {09A03980-D14A-4705-A38C-741AD7166DEE}.Release|Any CPU.ActiveCfg = Release|Any CPU {09A03980-D14A-4705-A38C-741AD7166DEE}.Release|Any CPU.Build.0 = Release|Any CPU + {A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE