Browse Source

Add UpdateAssemblyInfo.exe.manifest - prevents UAC popups when compiling SharpDevelop on Vista

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1626 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
eb5a5ec721
  1. 39
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/SharpDevelopHost.cs
  2. 5
      src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj
  3. 15
      src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.exe.manifest

39
src/Main/ICSharpCode.SharpDevelop.Sda/Src/SharpDevelopHost.cs

@ -227,6 +227,45 @@ namespace ICSharpCode.SharpDevelop.Sda @@ -227,6 +227,45 @@ namespace ICSharpCode.SharpDevelop.Sda
}
#endregion
#region CreateInstanceInTargetDomain
/// <summary>
/// Gets the AppDomain used to host SharpDevelop.
/// </summary>
public AppDomain AppDomain {
get {
return appDomain;
}
}
/// <summary>
/// Creates an instance of the specified type argument in the target AppDomain.
/// </summary>
/// <param name="arguments">Arguments to pass to the constructor of <paramref name="type"/>.</param>
/// <returns>The constructed object.</returns>
[SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
public T CreateInstanceInTargetDomain<T>(params object[] arguments) where T : MarshalByRefObject
{
Type type = typeof(T);
return (T)appDomain.CreateInstanceAndUnwrap(type.Assembly.FullName, type.FullName, arguments);
}
/// <summary>
/// Creates an instance of the specified type in the target AppDomain.
/// </summary>
/// <param name="type">Type to create an instance of.</param>
/// <param name="arguments">Arguments to pass to the constructor of <paramref name="type"/>.</param>
/// <returns>The constructed object.</returns>
[SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")]
public object CreateInstanceInTargetDomain(Type type, params object[] arguments)
{
if (type == null)
throw new ArgumentNullException("type");
if (typeof(MarshalByRefObject).IsAssignableFrom(type) == false)
throw new ArgumentException("type does not inherit from MarshalByRefObject", "type");
return appDomain.CreateInstanceAndUnwrap(type.Assembly.FullName, type.FullName, arguments);
}
#endregion
#region Callback Events
System.ComponentModel.ISynchronizeInvoke invokeTarget;

5
src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj

@ -39,5 +39,10 @@ @@ -39,5 +39,10 @@
<Compile Include="Main.cs" />
<None Include="Readme.txt" />
</ItemGroup>
<ItemGroup>
<Content Include="UpdateAssemblyInfo.exe.manifest">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project>

15
src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.exe.manifest

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description>Updates the assembly version in GlobalAssemblyInfo.cs</description>
<!-- required because Vista otherwise thinks UpdateAssemblyInfo requires admin rights -->
<!-- because it contains the word "Update" -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Loading…
Cancel
Save