int file_subtype;
long file_date;
+ int file_lang;
+ int file_codepage;
+
Hashtable properties;
public Win32VersionResource (int id, int language) : base (Win32ResourceType.RT_VERSION, id, language) {
file_subtype = 0;
file_date = 0;
+ file_lang = 0x7f;
+ file_codepage = 1200;
+
properties = new Hashtable ();
// Well known properties
}
set {
- int[] ver = new int [4] { 0, 0, 0, 0 };
+ long[] ver = new long [4] { 0, 0, 0, 0 };
if (value != null) {
string[] parts = value.Split ('.');
}
}
+ public virtual string InternalName {
+ get {
+ return (string)properties ["InternalName"];
+ }
+ set {
+ properties ["InternalName"] = value == String.Empty ? " " : value;
+ }
+ }
+
+ public virtual string FileDescription {
+ get {
+ return (string)properties ["FileDescription"];
+ }
+ set {
+ properties ["FileDescription"] = value == String.Empty ? " " : value;
+ }
+ }
+
+ public virtual int FileLanguage {
+ get {
+ return file_lang;
+ }
+ set {
+ file_lang = value;
+ }
+ }
+
private void emit_padding (BinaryWriter w) {
Stream ms = w.BaseStream;
public override void WriteTo (Stream ms)
{
using (BinaryWriter w = new BinaryWriter (ms, Encoding.Unicode)) {
- short len;
- long pos;
-
//
// See the documentation for the VS_VERSIONINFO structure and
// its children on MSDN
if ((ms.Position % 4) != 0)
w.Write ((short)0);
- w.Write ((short)0x7f);
- w.Write ((short)1200);
+ w.Write ((short)file_lang);
+ w.Write ((short)file_codepage);
patch_length (w, var_pos);
w.Write ((short)0);
w.Write ((short)0);
w.Write ((short)1);
- w.Write ("007f04b0".ToCharArray ());
+ w.Write (String.Format ("{0:x4}{1:x4}", file_lang, file_codepage).ToCharArray ());
emit_padding (w);
w.Write (value.ToCharArray ());
w.Write ((short)0);
+ emit_padding (w);
+
patch_length (w, string_pos);
}