DO NOT DEAL WITH THIS MEMBER
Aug 20, 2015 01:33 PM
(This post was last modified: Aug 21, 2015 02:38 AM by Jackie Chun.)
SOLUTION: You don't....
I want to know how to actually ADD a resource, not write an existing one. Does anyone have any clue on how to do this, google has yet again failed me.
I'm trying to do this
ZipFile.CreateFromDirectory(NewResource, MyResources)
Maybe I can't use createfromdirectory like that or that might not be how it works, but I want to save to my Resources. I just don't know how to,
DumbedDown: Click button, openfiledialog, choose .exe, it saves to resources for later use.
Also I've tried ResourceWriter and Adding a resource that way but as I stated I want to add actual Files, not just strings / text. Unless somehow I can manage it through memory or somethign idk.
Welp, I'm having a problem using a Boolean in a Loop with my Save to the fkn Folder Method.
Logic why do you fail me?
If you want to add a new resource to your executable at run time, that is impossible. Resources are stored in resx files, which is a custom XML structure, when images or binary files are added to the resx file, the bytes for the new item are stored in base64. The reason adding a new resource to your executable at run time is impossible, is actually because the resx file with all your resources is compiled into the resultiing binary. You would literally need to re-compile your application every time you want to change a resource.
If that is not what you want to do, ignore this post ;D
DO NOT DEAL WITH THIS MEMBER
(Aug 20, 2015 04:49 PM)Nikey646 Wrote: If you want to add a new resource to your executable at run time, that is impossible. Resources are stored in resx files, which is a custom XML structure, when images or binary files are added to the resx file, the bytes for the new item are stored in base64. The reason adding a new resource to your executable at run time is impossible, is actually because the resx file with all your resources is compiled into the resultiing binary. You would literally need to re-compile your application every time you want to change a resource.
If that is not what you want to do, ignore this post ;D
I want to add a new resource to my executable at run time.
My google adventures brought me across what you're talking about with resx files. There was something about using resXresourcewriter or some weird shit like that but I couldn't store actual files like Images or zip files to it only strings.
How do I make my program recompile it's self with a custom resx file that it adds to? I don't understand how this could be impossible, I mean physically adding files or copying them, into your file to store them shouldn't be "impossible".
You would have to code your own JIT compiler basically, if I'm not mistaken.
en . wikipedia . org/wiki/Just-in-time_compilation
DO NOT DEAL WITH THIS MEMBER
Can someone give me an example please?
Like this?
Code using (var writer = new ResourceWriter("mysettings.resources"))
{
writer.AddResource("Example1", "Hello");
writer.AddResource("Example2", 11);
writer.AddResource("Example3", File.ReadAllBytes("Add.exe"));
writer.Generate();
writer.Close();
}
Lotta blood to let, peace to make, give a fuk about a check
DO NOT DEAL WITH THIS MEMBER
(Aug 20, 2015 09:23 PM)BahNahNah Wrote: Like this?
Code using (var writer = new ResourceWriter("mysettings.resources"))
{
writer.AddResource("Example1", "Hello");
writer.AddResource("Example2", 11);
writer.AddResource("Example3", File.ReadAllBytes("Add.exe"));
writer.Generate();
writer.Close();
}
Specifically not. I thought I CLEARLY covered that, guess not.
|