Skip to content

Commit

Permalink
Added support for Proxy.
Browse files Browse the repository at this point in the history
Incremented version to 1.3
  • Loading branch information
deepak-rathi committed Oct 9, 2018
1 parent 359c243 commit 3e4aad2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Setup/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<!-- The manufacturer, for setup package publisher and folder info -->
<?define Manufacturer = "Deepak Rathi" ?>
<!-- The version number of this setup package-->
<?define Version = "1.2.0" ?>
<?define Version = "1.3.0" ?>
<!-- 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 -->
Expand Down
4 changes: 2 additions & 2 deletions VS2017OfflineSetupUtility/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
4 changes: 2 additions & 2 deletions VS2017OfflineSetupUtility/Utils/FeatureUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ internal static List<Feature> GetFeatures()
var cleanUtilIcon = new CleanUtilIcon() { IsCheckedColor = (SolidColorBrush)App.Current.Resources["BlueSolidColorBrush"]};
cleanUtilIcon.SetBinding(CleanUtilIcon.IsCheckedProperty, new System.Windows.Data.Binding("IsSelected") { UpdateSourceTrigger = System.Windows.Data.UpdateSourceTrigger.PropertyChanged});

var cleanUtilFeature = new Feature() { Icon = cleanUtilIcon, Name = "VS2017 Offline Clean Util", About= "Allow deletion of old version Visual Studio 2017 Offline Setup files and folder, which saves your hard disk space.", Version="1.1.0.0", NavigateToView = new Views.CleanUtilPage() , IsSelected = true};
var cleanUtilFeature = new Feature() { Icon = cleanUtilIcon, Name = "VS2017 Offline Clean Util", About= "Allow deletion of old version Visual Studio 2017 Offline Setup files and folder, which saves your hard disk space.", Version="1.3.0.0", NavigateToView = new Views.CleanUtilPage() , IsSelected = true};

#endregion

#region Download Util Feature
var downloadUtilIcon = new DownloadUtilIcon() { IsCheckedColor = (SolidColorBrush)App.Current.Resources["BlueSolidColorBrush"]};
downloadUtilIcon.SetBinding(DownloadUtilIcon.IsCheckedProperty, new System.Windows.Data.Binding("IsSelected") { UpdateSourceTrigger = System.Windows.Data.UpdateSourceTrigger.PropertyChanged });

var downloadUtilFeature = new Feature() { Icon = downloadUtilIcon, Name = "VS2017 Offline Download", About = "Download Visual Studio 2017 Offline Setup files and folder, using command line interface. (Need internet connection)", Version = "1.1.0.0" , NavigateToView = new Views.DownloadUtilPage()};
var downloadUtilFeature = new Feature() { Icon = downloadUtilIcon, Name = "VS2017 Offline Download", About = "Download Visual Studio 2017 Offline Setup files and folder, using command line interface. (Need internet connection)", Version = "1.3.0.0" , NavigateToView = new Views.DownloadUtilPage()};

#endregion

Expand Down
12 changes: 10 additions & 2 deletions VS2017OfflineSetupUtility/ViewModels/DownloadUtilPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,11 @@ private void DownloadWorkloadFromWeb(string vsEdition)
string markdownText = null;
try
{
markdownText = new WebClient().DownloadString(selectedVsEdition.WorkloadGitHubUri);
WebClient webClient = new WebClient();
IWebProxy webProxy = WebRequest.DefaultWebProxy;
webProxy.Credentials = CredentialCache.DefaultCredentials;
webClient.Proxy = webProxy;
markdownText = webClient.DownloadString(selectedVsEdition.WorkloadGitHubUri);

}
catch (Exception exception)
Expand Down Expand Up @@ -266,8 +270,12 @@ public DelegateCommand DownloadCommand
var subdirInfo = dirInfo.CreateSubdirectory("Setup");
try
{
WebClient webClient = new WebClient();
IWebProxy webProxy = WebRequest.DefaultWebProxy;
webProxy.Credentials = CredentialCache.DefaultCredentials;
webClient.Proxy = webProxy;
//Download Setup exe from web
new WebClient().DownloadFile(new Uri(selectedVsEdition.SetupUri), subdirInfo.FullName + @"\vs_" + selectedVsEdition.Name + ".exe");
webClient.DownloadFile(new Uri(selectedVsEdition.SetupUri), subdirInfo.FullName + @"\vs_" + selectedVsEdition.Name + ".exe");
File.WriteAllText(subdirInfo.FullName + @"\CliCommand.bat", CliText);
Process.Start(new ProcessStartInfo()
{
Expand Down
Binary file modified VS2017OfflineSetupUtility/bin/Release/VS2017OfflineSetupUtility.exe
Binary file not shown.
Binary file not shown.

0 comments on commit 3e4aad2

Please sign in to comment.