Skip to content

Commit

Permalink
Upgraded to .Net Core 3.1
Browse files Browse the repository at this point in the history
Upgraded packages.config
Removed dependency on WindowsAPICodePack
  • Loading branch information
deepak-rathi committed Apr 8, 2020
1 parent fa9e951 commit 2ff3095
Show file tree
Hide file tree
Showing 10 changed files with 304 additions and 91 deletions.
142 changes: 142 additions & 0 deletions Setup/Product.Core.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright © 2017-2020 Deepak Rathi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see<http://www.gnu.org/licenses/> .
-->
<!-- The name of the product -->
<?define Name = "VS2017 2019 Offline Setup Utility" ?>
<!-- The Description of the product -->
<?define Description = "This utility allow downloading offline setup or deletion of old version Visual Studio 2017 2019 Offline Setup files and folder" ?>
<!-- The manufacturer, for setup package publisher and folder info -->
<?define Manufacturer = "Deepak Rathi" ?>
<!-- The version number of this setup package-->
<?define Version = "1.3.3" ?>
<!-- UpgradeCode must be unique and not changed once the first version of the program is installed. -->
<?define UpgradeCode = "a49a94d4-f09a-4e3b-9b7e-b058cddd504e" ?>
<!-- The name of the Cabinet -->
<?define CabName = "VS20172019OfflineSetupUtil.cab" ?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

<!--Variable for Application Directory-->
<?define VS2017OfflineSetupUtil_Application_TargetDir=$(var.VS2017OfflineSetupUtility.TargetDir)?>

<Product Id="*" Name="$(var.Name)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)" Version="$(var.Version)" Language="1033">

<!--Setup or Installer with properties-->
<Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" InstallPrivileges="limited" Description="$(var.Name)" Manufacturer="$(var.Manufacturer)" />

<!--Application logo-->
<Icon Id="Logo.ico" SourceFile="$(var.VS2017OfflineSetupUtility.TargetDir)\Assets\logo.ico" />

<!--Application logo for Control Panel-->
<Property Id="ARPPRODUCTICON" Value="Logo.ico" />

<!--Embed Cabinet into single msi file-->
<Media Id="1" Cabinet="$(var.CabName)" EmbedCab="yes" />

<!-- Allow upgrades and prevent downgrades -->
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

<!--Main Feature for this Setup which can be found in Fragment Tag with ComponentGroupRef Id-->
<Feature Id="ProductFeature" Title="$(var.Name)" Level="1">
<!--Main application executable component-->
<ComponentGroupRef Id="ProductComponents" />
<!--Main application shortcut for Program Menu-->
<ComponentRef Id="ApplicationShortcut" />
<!--Desktop shortcut-->
<ComponentGroupRef Id="ComponentGroupDesktopShortcut" />
</Feature>
</Product>

<!--Fragment with details of installation directory-->
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="LocalAppDataFolder">
<!-- Create a folder inside program files with Company Name-->
<Directory Id="ROOTDIRECTORY" Name="$(var.Manufacturer)">
<!-- Create a folder inside Company Name folder with Product Name-->
<Directory Id="INSTALLFOLDER" Name="$(var.Name)">
<Directory Id="DesktopFolder" Name="DesktopFolder" />
</Directory>
</Directory>
</Directory>
<!--Create application folder in Program Menu-->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="$(var.Name)" />
</Directory>
</Directory>
</Fragment>

<!--Main Feature Fragment with application executable-->
<Fragment>
<!--ComponentGroup refering to install component in INSTALLFOLDER Directory-->
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!--Main Component with Sample Application executable path-->
<Component Id="VS2017OfflineSetupUtil_Application.exe" Guid="*">
<File Id="VS2017OfflineSetupUtil_Application.exe" Name="VS2017OfflineSetupUtility.exe" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)VS2017OfflineSetupUtility.exe" />
<!-- Remove all files from the INSTALLFOLDER on uninstall -->
<RemoveFile Id="ALLFILES" Name="*.*" On="both" />
</Component>
<!--Component with file of VS2017OfflineSetupUtil application-->
<Component Id="VS2017OfflineSetupUtil_Application.dll" Guid="*">
<File Id="VS2017OfflineSetupUtil_Application.dll" Name="VS2017OfflineSetupUtility.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)VS2017OfflineSetupUtility.dll" />
</Component>
<Component Id="VS2017OfflineSetupUtil_Application.dll.config" Guid="*">
<File Id="VS2017OfflineSetupUtil_Application.dll.config" Name="VS2017OfflineSetupUtility.dll.config" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)VS2017OfflineSetupUtility.dll.config" />
</Component>

<Component Id="VS2017OfflineSetupUtil_Application.deps.json" Guid="*">
<File Id="VS2017OfflineSetupUtil_Application.deps.json" Name="VS2017OfflineSetupUtility.deps.json" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)VS2017OfflineSetupUtility.deps.json" />
</Component>
<Component Id="VS2017OfflineSetupUtil_Application.runtimeconfig.json" Guid="*">
<File Id="VS2017OfflineSetupUtil_Application.runtimeconfig.json" Name="VS2017OfflineSetupUtility.runtimeconfig.json" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)VS2017OfflineSetupUtility.runtimeconfig.json" />
</Component>

<Component Id="Newtonsoft.Json.dll" Guid="*">
<File Id="Newtonsoft.Json.dll" Name="Newtonsoft.Json.dll" Source="$(var.VS2017OfflineSetupUtil_Application_TargetDir)Newtonsoft.Json.dll" />
</Component>
</ComponentGroup>
</Fragment>

<Fragment>
<DirectoryRef Id="ApplicationProgramsFolder">
<!--Create application shortcut in Program Menu-->
<Component Id="ApplicationShortcut" Guid="*">
<Shortcut Id="ApplicationStartMenuShortcut" Name="$(var.Name)" Description="$(var.Description)" Icon="Logo.ico" Target="[#VS2017OfflineSetupUtil_Application.exe]" WorkingDirectory="INSTALLFOLDER" />
<!--Remove application shortcut from Program Menu on uninstall-->
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall" />
<!--Create application registry entry-->
<RegistryValue Root="HKCU" Key="Software\Microsoft\$(var.Manufacturer)\$(var.Name)" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>

<Fragment>
<!--Desktop Shortcut-->
<ComponentGroup Id="ComponentGroupDesktopShortcut">
<Component Id="ComponentDesktopShortcut" Guid="*" Directory="DesktopFolder" >
<Shortcut Id="AppDesktopShortcut"
Name="$(var.Name)"
Description="$(var.Description)"
Directory="DesktopFolder"
Target="[#Sample_Application.exe]"
WorkingDirectory="INSTALLFOLDER"/>
<!--Remove desktop shortcut on uninstall-->
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\$(var.Manufacturer)\$(var.Name)" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
49 changes: 49 additions & 0 deletions Setup/Setup.Core.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>1de5ec25-4759-43d1-a48f-33fca5ff3134</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>VS2017 2019 Offline Setup Utility</OutputName>
<OutputType>Package</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<SuppressAllWarnings>False</SuppressAllWarnings>
<Pedantic>False</Pedantic>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.Core.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VS2017OfflineSetupUtility\VS2017OfflineSetupUtility.Core.csproj">
<Name>VS2017OfflineSetupUtility</Name>
<Project>{CFDA2EA7-899E-417F-881A-905A3ED836D6}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
</ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
25 changes: 13 additions & 12 deletions VS2017OfflineSetupUtility.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26403.3
# Visual Studio Version 16
VisualStudioVersion = 16.0.29920.165
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS2017OfflineSetupUtility", "VS2017OfflineSetupUtility\VS2017OfflineSetupUtility.csproj", "{7163237C-B16D-4B76-84FC-081891585EC4}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Setup", "Setup\Setup.wixproj", "{1DE5EC25-4759-43D1-A48F-33FCA5FF3134}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VS2017OfflineSetupUtility.Core", "VS2017OfflineSetupUtility\VS2017OfflineSetupUtility.Core.csproj", "{CFDA2EA7-899E-417F-881A-905A3ED836D6}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Setup", "Setup\Setup.Core.wixproj", "{1DE5EC25-4759-43D1-A48F-33FCA5FF3134}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,20 +16,20 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7163237C-B16D-4B76-84FC-081891585EC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7163237C-B16D-4B76-84FC-081891585EC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7163237C-B16D-4B76-84FC-081891585EC4}.Debug|x86.ActiveCfg = Debug|Any CPU
{7163237C-B16D-4B76-84FC-081891585EC4}.Debug|x86.Build.0 = Debug|Any CPU
{7163237C-B16D-4B76-84FC-081891585EC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7163237C-B16D-4B76-84FC-081891585EC4}.Release|Any CPU.Build.0 = Release|Any CPU
{7163237C-B16D-4B76-84FC-081891585EC4}.Release|x86.ActiveCfg = Release|Any CPU
{7163237C-B16D-4B76-84FC-081891585EC4}.Release|x86.Build.0 = Release|Any CPU
{1DE5EC25-4759-43D1-A48F-33FCA5FF3134}.Debug|Any CPU.ActiveCfg = Debug|x86
{1DE5EC25-4759-43D1-A48F-33FCA5FF3134}.Debug|x86.ActiveCfg = Debug|x86
{1DE5EC25-4759-43D1-A48F-33FCA5FF3134}.Debug|x86.Build.0 = Debug|x86
{1DE5EC25-4759-43D1-A48F-33FCA5FF3134}.Release|Any CPU.ActiveCfg = Release|x86
{1DE5EC25-4759-43D1-A48F-33FCA5FF3134}.Release|x86.ActiveCfg = Release|x86
{1DE5EC25-4759-43D1-A48F-33FCA5FF3134}.Release|x86.Build.0 = Release|x86
{CFDA2EA7-899E-417F-881A-905A3ED836D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CFDA2EA7-899E-417F-881A-905A3ED836D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CFDA2EA7-899E-417F-881A-905A3ED836D6}.Debug|x86.ActiveCfg = Debug|Any CPU
{CFDA2EA7-899E-417F-881A-905A3ED836D6}.Debug|x86.Build.0 = Debug|Any CPU
{CFDA2EA7-899E-417F-881A-905A3ED836D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CFDA2EA7-899E-417F-881A-905A3ED836D6}.Release|Any CPU.Build.0 = Release|Any CPU
{CFDA2EA7-899E-417F-881A-905A3ED836D6}.Release|x86.ActiveCfg = Release|Any CPU
{CFDA2EA7-899E-417F-881A-905A3ED836D6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
8 changes: 0 additions & 8 deletions VS2017OfflineSetupUtility/App.config
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="VS2017OfflineSetupUtility.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<userSettings>
<VS2017OfflineSetupUtility.Properties.Settings>
<setting name="LastSelectedFolder" serializeAs="String">
Expand Down
7 changes: 7 additions & 0 deletions VS2017OfflineSetupUtility/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"profiles": {
"VS2017OfflineSetupUtility.Core": {
"commandName": "Project"
}
}
}
56 changes: 56 additions & 0 deletions VS2017OfflineSetupUtility/VS2017OfflineSetupUtility.Core.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<StartupObject>VS2017OfflineSetupUtility.App</StartupObject>
<Version>1.4.1</Version>
<Product>VS2017 Offline Setup Utility</Product>
<PackageLicenseExpression></PackageLicenseExpression>
<Company />
<Authors>Deepak Rathi</Authors>
<PackageIcon></PackageIcon>
<RepositoryUrl>https://github.com/deepak-rathi/VS2017OfflineSetupUtility</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageReleaseNotes>Added .Net Core 3.1</PackageReleaseNotes>
<PackageId>VS2017OfflineSetupUtility</PackageId>
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Copyright>Copyright © 2017-2020 Deepak Rathi</Copyright>
<Description>This utility allow downloading offline setup or deletion of old version Visual Studio 2017/2019 Offline Setup files and folder.</Description>
<AssemblyName>VS2017OfflineSetupUtility</AssemblyName>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE</DefineConstants>
<Optimize>false</Optimize>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Properties\AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<None Remove="Assets\logo.ico" />
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Assets\logo.ico">
<Pack>True</Pack>
<PackagePath></PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

</Project>
17 changes: 6 additions & 11 deletions VS2017OfflineSetupUtility/VS2017OfflineSetupUtility.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,9 @@
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -126,7 +118,6 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down Expand Up @@ -165,6 +156,10 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Loading

0 comments on commit 2ff3095

Please sign in to comment.