Skip to content

Commit

Permalink
Added NuSpec for Resources library and incremented the version number…
Browse files Browse the repository at this point in the history
…s. Updated the build file as well.
  • Loading branch information
lkinsella committed Jul 7, 2016
1 parent a61012d commit 8fe4b68
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 15 deletions.
3 changes: 2 additions & 1 deletion Build/build.bat
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
..\Tools\nuget pack ..\Src\Workshell.PE\Workshell.PE.csproj -Build -Prop Configuration=Release;
..\Tools\nuget pack ..\Src\Workshell.PE\Workshell.PE.csproj -Build -Prop Configuration=Release;
..\Tools\nuget pack ..\Src\Workshell.PE.Resources\Workshell.PE.Resources.csproj -Build -Prop Configuration=Release;
20 changes: 10 additions & 10 deletions Src/Demo Application/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ static void Main(string[] args)
//string file_name = Assembly.GetEntryAssembly().Location;
//string file_name = @"C:\Windows\SysWOW64\kernel32.dll";
//string file_name = @"C:\Windows\System32\kernel32.dll";
string file_name = @"C:\Windows\SysWOW64\shell32.dll";
//string file_name = @"C:\Windows\SysWOW64\shell32.dll";
//string file_name = @"C:\Windows\System32\shell32.dll";
string file_name = @"C:\Windows\System32\user32.dll";
//string file_name = @"C:\Windows\explorer.exe";
//string file_name = @"C:\Windows\SysWOW64\xpsservices.dll";
//string file_name = @"c:\windows\system32\advapi32.dll";
string error_message;
Expand All @@ -37,15 +39,13 @@ static void Main(string[] args)

ExecutableImage image = ExecutableImage.FromFile(file_name);
Resources resources = Resources.Get(image);
ResourceType icon_groups = resources.FirstOrDefault(type => type.Id == ResourceType.RT_GROUP_ICON);
Resource group_resource = icon_groups.FirstOrDefault(res => res.Id == 7);
IconGroupResource icon_group = IconGroupResource.Load(group_resource, Resource.DEFAULT_LANGUAGE);
IconGroupResourceEntry icon_entry = icon_group.FirstOrDefault();
ResourceType icons = resources.FirstOrDefault(type => type.Id == ResourceType.RT_ICON);
Resource resource = icons.FirstOrDefault(res => res.Id == /*icon_entry.IconId*/105);
IconResource icon_resource = IconResource.FromResource(resource, Resource.DEFAULT_LANGUAGE);

icon_group.Save(@"D:\test.ico", IconGroupFormat.Icon);
ResourceType types = resources.First(t => t.Id == ResourceType.RT_BITMAP);
Resource resource = types.First(t => t.Id == 32661);
BitmapResource bitmap_resource = BitmapResource.Load(resource);

var x = bitmap_resource.ToBitmap();

x.Save(@"D:\test.bmp");

//Console.ReadKey();
}
Expand Down
4 changes: 2 additions & 2 deletions Src/Workshell.PE.Resources/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,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.0.*")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyVersion("1.1.*")]
[assembly: AssemblyInformationalVersion("1.1.0")]
22 changes: 22 additions & 0 deletions Src/Workshell.PE.Resources/Workshell.PE.Resources.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Workshell.PE.Resources</id>
<version>$version$</version>
<title>Workshell PE Resource Extentensions</title>
<summary>A set of extensions for Workshell PE to help deal with resources.</summary>
<description>A set of classes to help deal with resources within an executable such as bitmaps, icons and cursors.</description>
<authors>Workshell Ltd</authors>
<copyright>Workshell Ltd</copyright>
<language>en-US</language>
<projectUrl>https://github.com/Workshell/pe</projectUrl>
<licenseUrl>https://raw.githubusercontent.com/Workshell/pe/master/license.txt</licenseUrl>
<iconUrl>http://img.workshell.co.uk/logo_128.png</iconUrl>
<tags>pe executable native resources</tags>
<dependencies>
<group targetFramework=".NETFramework4.0">
<dependency id="Workshell.PE" version="$version$" />
</group>
</dependencies>
</metadata>
</package>
4 changes: 2 additions & 2 deletions Src/Workshell.PE/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
//
// 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: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyVersion("1.1.*")]
[assembly: AssemblyInformationalVersion("1.1.0")]

#if !SIGNED
[assembly: InternalsVisibleTo("peres")]
Expand Down

0 comments on commit 8fe4b68

Please sign in to comment.