Skip to content

Commit

Permalink
New logo, Switch to AsyncPackage
Browse files Browse the repository at this point in the history
  • Loading branch information
sboulema committed Jun 11, 2018
1 parent d7e9c13 commit aee32ad
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 38 deletions.
2 changes: 1 addition & 1 deletion RunAsAdmin/Resources/License.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Samir Boulema
Copyright (c) 2018 Samir Boulema

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Binary file added RunAsAdmin/Resources/RunAsAdmin.pdn
Binary file not shown.
Binary file added RunAsAdmin/Resources/RunAsAdmin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed RunAsAdmin/Resources/run.ico
Binary file not shown.
Binary file removed RunAsAdmin/Resources/run.jpg
Binary file not shown.
12 changes: 7 additions & 5 deletions RunAsAdmin/RunAsAdmin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="Resources\run.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="Resources\run.ico">
<Content Include="Resources\RunAsAdmin.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
Expand All @@ -190,6 +186,10 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\Microsoft.VisualStudio.SDK.Analyzers.15.7.7\analyzers\cs\Microsoft.VisualStudio.SDK.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.7.18\analyzers\cs\Microsoft.VisualStudio.Threading.Analyzers.dll" />
</ItemGroup>
<PropertyGroup>
<UseCodebase>true</UseCodebase>
</PropertyGroup>
Expand All @@ -201,8 +201,10 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.7.18\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.7.18\build\Microsoft.VisualStudio.Threading.Analyzers.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" />
<Import Project="..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.7.18\build\Microsoft.VisualStudio.Threading.Analyzers.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.7.18\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
15 changes: 9 additions & 6 deletions RunAsAdmin/RunAsAdminPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,26 @@

namespace SamirBoulema.RunAsAdmin
{
[PackageRegistration(UseManagedResourcesOnly = true)]
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
[ProvideAutoLoad(UIContextGuids80.NoSolution)]
[ProvideAutoLoad(UIContextGuids80.NoSolution, PackageAutoLoadFlags.BackgroundLoad)]
[Guid(GuidList.guidRunAsAdminPkgString)]
[ProvideOptionPage(typeof(OptionPageGrid), "RunAsAdmin", "General", 0, 0, true)]
public sealed class RunAsAdminPackage : Package
public sealed class RunAsAdminPackage : AsyncPackage
{
private DTE _dte;
private string _devenvFilename;
private const string RegistryFolder = @"HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\";

protected override void Initialize()
protected override async System.Threading.Tasks.Task InitializeAsync(System.Threading.CancellationToken cancellationToken,
IProgress<ServiceProgressData> progress)
{
base.Initialize();
_dte = await GetServiceAsync(typeof(DTE)) as DTE;

await base.InitializeAsync(cancellationToken, progress);

var options = (OptionPageGrid)GetDialogPage(typeof(OptionPageGrid));
options.SetPackage(this);
_dte = (DTE)GetService(typeof(DTE));
_devenvFilename = _dte.Application.FileName;

var regEntry = Registry.GetValue(RegistryFolder, _devenvFilename, null);
Expand Down
2 changes: 2 additions & 0 deletions RunAsAdmin/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<package id="EnvDTE" version="8.0.1" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Imaging" version="14.3.25407" targetFramework="net461" />
<package id="Microsoft.VisualStudio.OLE.Interop" version="7.10.6070" targetFramework="net45" />
<package id="Microsoft.VisualStudio.SDK.Analyzers" version="15.7.7" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.14.0" version="14.3.25407" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Immutable.10.0" version="10.0.30319" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Immutable.11.0" version="11.0.50727" targetFramework="net461" />
Expand All @@ -14,6 +15,7 @@
<package id="Microsoft.VisualStudio.TextManager.Interop" version="7.10.6070" targetFramework="net45" />
<package id="Microsoft.VisualStudio.TextManager.Interop.8.0" version="8.0.50727" targetFramework="net45" />
<package id="Microsoft.VisualStudio.Threading" version="14.1.111" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Threading.Analyzers" version="15.7.18" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Utilities" version="14.3.25407" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Validation" version="14.1.111" targetFramework="net461" />
<package id="Microsoft.VSSDK.BuildTools" version="15.0.26201" targetFramework="net461" developmentDependency="true" />
Expand Down
50 changes: 25 additions & 25 deletions RunAsAdmin/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="dda2a29d-8fd9-4131-adc5-afcf6ef36b25" Version="1.3" Language="en-US" Publisher="Samir L. Boulema" />
<DisplayName>RunAsAdmin</DisplayName>
<Description>Run Visual Studio as administrator</Description>
<MoreInfo>https://github.com/sboulema/RunAsAdmin</MoreInfo>
<License>Resources\License.txt</License>
<GettingStartedGuide>https://github.com/sboulema/RunAsAdmin/blob/master/README.md</GettingStartedGuide>
<ReleaseNotes>https://github.com/sboulema/RunAsAdmin/releases</ReleaseNotes>
<Icon>Resources\run.ico</Icon>
<PreviewImage>Resources\run.jpg</PreviewImage>
<Tags>Run As, Admin, Administrator, Root</Tags>
</Metadata>
<Installation InstalledByMsi="false">
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[14.0,15.0]" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
<Dependency Id="Microsoft.VisualStudio.MPF.14.0" DisplayName="Visual Studio MPF 14.0" d:Source="Installed" Version="[14.0]" />
</Dependencies>
<Assets>
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
</Assets>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.26004.1,16.0)" DisplayName="Visual Studio core editor" />
</Prerequisites>
<Metadata>
<Identity Id="dda2a29d-8fd9-4131-adc5-afcf6ef36b25" Version="1.4" Language="en-US" Publisher="Samir L. Boulema" />
<DisplayName>RunAsAdmin</DisplayName>
<Description xml:space="preserve">Run Visual Studio as administrator</Description>
<MoreInfo>https://github.com/sboulema/RunAsAdmin</MoreInfo>
<License>Resources\License.txt</License>
<GettingStartedGuide>https://github.com/sboulema/RunAsAdmin/blob/master/README.md</GettingStartedGuide>
<ReleaseNotes>https://github.com/sboulema/RunAsAdmin/releases</ReleaseNotes>
<Icon>Resources\RunAsAdmin.png</Icon>
<PreviewImage>Resources\RunAsAdmin.png</PreviewImage>
<Tags>Run As, Admin, Administrator, Root</Tags>
</Metadata>
<Installation InstalledByMsi="false">
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[14.0,15.0]" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
<Dependency Id="Microsoft.VisualStudio.MPF.14.0" DisplayName="Visual Studio MPF 14.0" d:Source="Installed" Version="[14.0]" />
</Dependencies>
<Assets>
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
</Assets>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.26004.1,16.0)" DisplayName="Visual Studio core editor" />
</Prerequisites>
</PackageManifest>
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.3.{build}
version: 1.4.{build}
skip_tags: true
configuration:
- Release
Expand Down

0 comments on commit aee32ad

Please sign in to comment.