From f541e7105ebee7537bde8880897ab65f3047a93a Mon Sep 17 00:00:00 2001 From: martinchrzan Date: Wed, 29 Jul 2020 23:45:41 +0200 Subject: [PATCH] Generating AssemblyInfo.cs for ColorPicker.exe, added resources and version for ColorPicker.dll (#5299) --- .../colorPicker/ColorPicker/ColorPicker.rc | 42 ++++++++++++++ .../ColorPicker/ColorPicker.vcxproj | 4 ++ .../colorPicker/ColorPicker/dllmain.cpp | 6 +- .../colorPicker/ColorPicker/resource.h | 16 ++++++ .../ColorPickerUI/ColorPickerUI.csproj | 47 +++++++++++++++- .../ColorPickerUI/Properties/AssemblyInfo.cs | 55 ------------------- 6 files changed, 109 insertions(+), 61 deletions(-) create mode 100644 src/modules/colorPicker/ColorPicker/ColorPicker.rc create mode 100644 src/modules/colorPicker/ColorPicker/resource.h delete mode 100644 src/modules/colorPicker/ColorPickerUI/Properties/AssemblyInfo.cs diff --git a/src/modules/colorPicker/ColorPicker/ColorPicker.rc b/src/modules/colorPicker/ColorPicker/ColorPicker.rc new file mode 100644 index 0000000000..c9cdc76805 --- /dev/null +++ b/src/modules/colorPicker/ColorPicker/ColorPicker.rc @@ -0,0 +1,42 @@ +#include +#include "resource.h" +#include "../../../common/version.h" + +STRINGTABLE +BEGIN + IDS_LAUNCHER_NAME L"Color Picker" + IDS_LAUNCHER_SETTINGS_DESC L"This feature requires Windows 10 version 1903 or higher" +END + +1 VERSIONINFO +FILEVERSION FILE_VERSION +PRODUCTVERSION PRODUCT_VERSION +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG +FILEFLAGS VS_FF_DEBUG +#else +FILEFLAGS 0x0L +#endif +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset + BEGIN + VALUE "CompanyName", COMPANY_NAME + VALUE "FileDescription", FILE_DESCRIPTION + VALUE "FileVersion", FILE_VERSION_STRING + VALUE "InternalName", INTERNAL_NAME + VALUE "LegalCopyright", COPYRIGHT_NOTE + VALUE "OriginalFilename", ORIGINAL_FILENAME + VALUE "ProductName", PRODUCT_NAME + VALUE "ProductVersion", PRODUCT_VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset + END +END diff --git a/src/modules/colorPicker/ColorPicker/ColorPicker.vcxproj b/src/modules/colorPicker/ColorPicker/ColorPicker.vcxproj index 5c2166b329..0d2a25e5a9 100644 --- a/src/modules/colorPicker/ColorPicker/ColorPicker.vcxproj +++ b/src/modules/colorPicker/ColorPicker/ColorPicker.vcxproj @@ -102,6 +102,7 @@ + @@ -114,6 +115,9 @@ {74485049-c722-400f-abe5-86ac52d929b3} + + + diff --git a/src/modules/colorPicker/ColorPicker/dllmain.cpp b/src/modules/colorPicker/ColorPicker/dllmain.cpp index b9054ee022..bcd7e15d81 100644 --- a/src/modules/colorPicker/ColorPicker/dllmain.cpp +++ b/src/modules/colorPicker/ColorPicker/dllmain.cpp @@ -3,6 +3,7 @@ #include #include #include "trace.h" +#include "resource.h" #include #include @@ -43,7 +44,7 @@ private: public: ColorPicker() { - app_name = L"ColorPicker"; + app_name = GET_RESOURCE_STRING(IDS_LAUNCHER_NAME); } ~ColorPicker() @@ -79,8 +80,7 @@ public: // Create a Settings object. PowerToysSettings::Settings settings(hinstance, get_name()); - settings.set_description(L"Color picker"); - // settings.set_description(GET_RESOURCE_STRING(IDS_LAUNCHER_SETTINGS_DESC)); + settings.set_description(GET_RESOURCE_STRING(IDS_LAUNCHER_SETTINGS_DESC)); settings.set_overview_link(L"https://aka.ms/PowerToysOverview_ColorPicker"); diff --git a/src/modules/colorPicker/ColorPicker/resource.h b/src/modules/colorPicker/ColorPicker/resource.h new file mode 100644 index 0000000000..eb78a31361 --- /dev/null +++ b/src/modules/colorPicker/ColorPicker/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ColorPicker.rc + +////////////////////////////// +// Non-localizable + +#define FILE_DESCRIPTION "PowerToys ColorPicker" +#define INTERNAL_NAME "ColorPicker" +#define ORIGINAL_FILENAME "ColorPicker.dll" + +// Non-localizable +////////////////////////////// + +#define IDS_LAUNCHER_NAME 601 +#define IDS_LAUNCHER_SETTINGS_DESC 602 diff --git a/src/modules/colorPicker/ColorPickerUI/ColorPickerUI.csproj b/src/modules/colorPicker/ColorPickerUI/ColorPickerUI.csproj index cc9a23bf56..4527a724be 100644 --- a/src/modules/colorPicker/ColorPickerUI/ColorPickerUI.csproj +++ b/src/modules/colorPicker/ColorPickerUI/ColorPickerUI.csproj @@ -1,6 +1,44 @@  + + + + ColorPicker + PowerToys ColorPicker + Microsoft Corp. + Copyright (C) 2020 Microsoft Corporation + PowerToys + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Debug AnyCPU @@ -40,6 +78,9 @@ MinimumRecommendedRules.ruleset true + + Resources\icon.ico + @@ -132,13 +173,13 @@ + + Code + - - Code - True True diff --git a/src/modules/colorPicker/ColorPickerUI/Properties/AssemblyInfo.cs b/src/modules/colorPicker/ColorPickerUI/Properties/AssemblyInfo.cs deleted file mode 100644 index e80d362d5f..0000000000 --- a/src/modules/colorPicker/ColorPickerUI/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ColorPickerUI")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ColorPickerUI")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")]