Re: [Lazarus] Resources
On 24.11.2013 03:26, Donald Ziesig wrote: Image1.Picture.LoadFromLazarusResource('PIX2'); // Tried 'pix2' as well Lazarus Resources FPC Resources Lazarus Resources where the resources that were used before FPC supported resources itself. So kick out the LResources unit and change the call to: === code begin === res := TResourceStream.Create(HInstance, 'PIX2', 'BITMAP'); try Image1.Picture.LoadFromStream(res); finally res.Free; end; === code end === If you know the file extension (e.g. you don't allow the users to put in a PNG resource while your default one is a BMP resource) you could also use LoadFromStreamWithFileExt instead. Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Resources
Hi All! I have been trying to use a resource file (mydata.rc) to include some bitmap images in an app but with no success. For simplicity, I have pared the rc file to a single line: pix2 BITMAP /home/mydir/Desktop/myapp/2.bmp I have the following lines in my main unit: {$R *.lfm} // the original {$R mydata.rc} mydata.rc is being compiled. It generates lib/x86_64-linux/mydata.res as expected. I can see the following in the compiled lib/x86_64-linux/mydata.res file using od B nul I nul T nul M nul A nul P nul and P nul I nul X nul 2 nul followed by the header of a bitmap image, so I am pretty sure that the resource compiler (windres) is working correctly. When I try to load the bitmap using: Image1.Picture.LoadFromLazarusResource('PIX2'); // Tried 'pix2' as well I constantly get Resource pix2 not found. I put some diagnostics in LResources.pp and I can see other resources being found, and pix2 being sought but it never finds a resource from the mydata.res file. It appears that whatever (I'm guessing here) has to be done to include the resources from mydata.res into the executable is not happening. I am using Lazarus V 1.1, and FPC V 2.6.2 Can anyone point me in the right direction? Thanks, Don Ziesig P.S. I started with PNG graphics and ended up with BMP only because that seemed to be the least common denominator in the all of the docs I could find. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Resources
{$R} (FPC style) resources are not the same as Lazarus resources. See: http://wiki.freepascal.org/Lazarus_Resources -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Resources-tp4034456p4034457.html Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] lazarus resources
I`ve make a very easy lazarus resource file, is annexed: unEdit_Add_Rem.lrs Description: Binary data , with two png files insides, and i`m using like this: btnAdd.Glyph.LoadFromLazarusResource('edit_add'); initialization {$I unEdit_Add_Rem.lrs} Generates this error: Exception Class: EInvalidGraphic With the Message: TGlyphBitmap: Unsupported Resourcetype: PNG Resource Name: edit_add Stack Trace: 00 - 0046C8E0 TGRAPHIC__LOADFROMLAZARUSRESOURCE, line 263 of ./include/graphic.inc. 01 - 00430940 TFMFILTRAR__BTNADDCLICK, line 246 of unFiltrar.pas. 02 - 004F0754 TCONTROL__CLICK, line 2288 of ./include/control.inc. 03 - 00531C21 TCUSTOMSPEEDBUTTON__CLICK, line 117 of ./include/speedbutton.inc. 04 - 005332E5 TCUSTOMSPEEDBUTTON__WMLBUTTONUP, line 799 of ./include/speedbutton.inc. 05 - 0040B8BA , line 9423 of . 06 - 004EE948 TCONTROL__PERFORM, line 1083 of ./include/control.inc. 07 - 004E4C62 TWINCONTROL__ISCONTROLMOUSEMSG, line 4606 of ./include/wincontrol.inc. 08 - 004E5EE9 TWINCONTROL__WNDPROC, line 5206 of ./include/wincontrol.inc. 09 - 00419F4E TCUSTOMFORM__WNDPROC, line 1362 of ./include/customform.inc. 10 - 00561867 DELIVERMESSAGE, line 110 of lclmessageglue.pas. 11 - 0050CFEE WINDOWPROC, line 2441 of win32callback.inc. 12 - 0059913F CUSTOMFORMWNDPROC, line 357 of win32wsforms.pp. 13 - 77D28709 , line 0 of . 14 - 77D287EB , line 0 of . 15 - 77D289A5 , line 0 of . 16 - 77D289E8 , line 0 of . I tough TSpeedButton could read png images. Any suggestions?-- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] lazarus resources
Each class can only read 1 format. btnAdd.Glyph is a TBitmap and therefore reads only bitmaps. But you can first read to a PNG and then use Assign to convert to a bitmap. Try doing it like this: var MyPNG: TPortableNetworkGraphic; begin MyPNG := TPortableNetworkGraphic; MyPNG.LoadFromLazarusResource('edit_add'); btnAdd.Glyph.Assign(MyPNG); MyPNG.Free; -- Felipe Monteiro de Carvalho -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] lazarus resources
Thanks! Em 07/02/2012, às 12:32, Felipe Monteiro de Carvalho escreveu: Each class can only read 1 format. btnAdd.Glyph is a TBitmap and therefore reads only bitmaps. But you can first read to a PNG and then use Assign to convert to a bitmap. Try doing it like this: var MyPNG: TPortableNetworkGraphic; begin MyPNG := TPortableNetworkGraphic; MyPNG.LoadFromLazarusResource('edit_add'); btnAdd.Glyph.Assign(MyPNG); MyPNG.Free; -- Felipe Monteiro de Carvalho -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Resources on Windows
On Thu, Jul 29, 2010 at 13:10, Paul Ishenin i...@kmiac.ru wrote: 29.07.2010 8:08, Alexander Klenin wrote: However, my question is -- is this yet another incompatible change made without any warning? Or did I miss it? I wrote about this change here: http://lazarus-dev.blogspot.com/2010/02/work-on-0930-changes-in-resource.html Hm, I admit that it is even written in bold red text. Still, I missed that. I remember that .lrs removal was rather well executed -- you have even specifically asked me to convert TAChart. But this issue was much more sneaky. The problem is that previosly we added to the project unit the next string (if resources were used): {$IFDEF WINDOWS}{$R projectname.rc}{$ENDIF} Now we add the next string instead: {$R *.res} Hm, so should I take the patch from the bug report as is (it just deletes $IFDEF line), or should I add $R line instead? I have just verified that all projects compile fine without $R -- is it really needed? We can add the code to IDE to replace old resource directive with the new one but what to do if developer added it by intention? IDE is already capable of messing up developer's changes to .lpr file, so I do not think adding one more case will make it any worse. Of course, the optimal plan would be to add specific diagnostics for this error, and let developer fix it himself. -- Alexander S. Klenin -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Resources on Windows
30.07.2010 9:07, Alexander Klenin wrote: No, Project Options - OK did not change .lpr file in any way. .res file did not appear either. This means that you have no resources: no manifest, no icon, no version information. Remove the old rc and manifest files if they are present and add a new res file instead. Then commit. You mean .res should be undef version control? Even though it is generated automatically? It is generated automatically only by IDE, not by the compiler. Best regards, Paul Ishenin. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
On 28 Jul 2010, at 06:56 AM, Paul Ishenin i...@kmiac.ru wrote: 26.07.2010 19:59, Mattias Gärtner wrote: Can you add some links or paragraphs on http://wiki.lazarus.freepascal.org/Lazarus_Resources about the new resources? Done. Oh brilliant, thanks so much. The article has a lot more information now. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Resources on Windows
29.07.2010 8:08, Alexander Klenin wrote: However, my question is -- is this yet another incompatible change made without any warning? Or did I miss it? I wrote about this change here: http://lazarus-dev.blogspot.com/2010/02/work-on-0930-changes-in-resource.html The problem is that previosly we added to the project unit the next string (if resources were used): {$IFDEF WINDOWS}{$R projectname.rc}{$ENDIF} Now we add the next string instead: {$R *.res} We can add the code to IDE to replace old resource directive with the new one but what to do if developer added it by intention? Best regards, Paul Ishenin. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
26.07.2010 19:59, Mattias Gärtner wrote: Can you add some links or paragraphs on http://wiki.lazarus.freepascal.org/Lazarus_Resources about the new resources? Done. Best regards, Paul Ishenin. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
From: Josh Lee [mailto:frozen-drago...@hotmail.com] Sent: 25 July 2010 12:11 You can add files as User-Defined resource types, or use RCDATA for raw (binary) data. See MSDN Resource Definition Statements, User-Defined Resources Thank you, I read up on them. Do you know where I can find a step by step tutorial on how to create a stand alone program that installs something on the hard disk? Or sample code I can build up on? Thanks. Please quote only the relevant parts of the original message. Sorry. - Josh InnoSetup is a fabulous installer for windows, and worth a look: http://www.jrsoftware.org/isinfo.php You can get the latest source via CVS. It'll be complicated to look through, but I'm sure you'll find some of what you're looking for. Last time I looked through the source for it was about 8 years ago, so it will have grown a bit since then... NB it's Delphi code, with some hacks that might not be fully compatible with FPC, but you should be OK reading it. Once you get the hang of them, resources are pretty easy - I'm sure you'll be fine :-) HTH DSP -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
InnoSetup is a fabulous installer for windows, and worth a look: http://www.jrsoftware.org/isinfo.php You can get the latest source via CVS. It'll be complicated to look through, but I'm sure you'll find some of what you're looking for. Last time I looked through the source for it was about 8 years ago, so it will have grown a bit since then... NB it's Delphi code, with some hacks that might not be fully compatible with FPC, but you should be OK reading it. Once you get the hang of them, resources are pretty easy - I'm sure you'll be fine :-) Yesh thank you, looking through the source is very educational. I love the idea that they implemented Pascal in it, so you can make custom scripts! It's like a non-GUI Lazarus ;) But isn't Delphi resources set out different from Lazarus resources? The first thing I'm going to do when I fully understand Lazarus resources is write an article on it, explaining how to do what I'm trying to do. :) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
On Mon, Jul 26, 2010 at 10:55 AM, Josh Lee frozen-drago...@hotmail.com wrote: Yesh thank you, looking through the source is very educational. I love the idea that they implemented Pascal in it, so you can make custom scripts! It's like a non-GUI Lazarus ;) But isn't Delphi resources set out different from Lazarus resources? Delphi uses Windows resources though the Windows API Lazarus supports 2 kinds of resources: Windows resources (RC files) and Lazarus resources (LRS files) using FPC/Lazarus APIs In that sense looking at the Inno Setup source code probably won't help much as it will probably be using Windows API which aren't portable. -- Felipe Monteiro de Carvalho -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
26.07.2010 18:23, Felipe Monteiro de Carvalho wrote: In that sense looking at the Inno Setup source code probably won't help much as it will probably be using Windows API which aren't portable. FPC resources api is compatible with windows. Best regards, Paul Ishenin. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
Zitat von Paul Ishenin webpi...@mail.ru: 26.07.2010 18:23, Felipe Monteiro de Carvalho wrote: In that sense looking at the Inno Setup source code probably won't help much as it will probably be using Windows API which aren't portable. FPC resources api is compatible with windows. Can you add some links or paragraphs on http://wiki.lazarus.freepascal.org/Lazarus_Resources about the new resources? Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
Josh, You can store a resource file on your exe by compiling a resource from a file via this tool ( http://lazarusbrasil.org/Resources.zip ) and adding the line {$R ResName.res} to your project. Then you can call the resource by name so: var ResStr :TResourceStream; begin ResStr := TResourceStream.Create(hInstance, ResName, ResType); try ResStr.SaveToFile(FileName'); finally ResStr.Free; end; end; -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
On 26 Jul 2010, at 01:20 PM, Antônio antoniog12...@gmail.com wrote: Josh, You can store a resource file on your exe by compiling a resource from a file via this tool ( http://lazarusbrasil.org/Resources.zip ) and adding the line {$R ResName.res} to your project. Then you can call the resource by name so: var ResStr :TResourceStream; begin ResStr := TResourceStream.Create(hInstance, ResName, ResType); try ResStr.SaveToFile(FileName'); finally ResStr.Free; end; end; -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus Thank you so much, this is exactly what I needed! :) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Lazarus Resources
I am now very confused. I have been told by someone on Lazarus Forums that to write an installer, I would need to use Resources. I have done some research into resources, and got this:Resource (Windows)From Wikipedia, the free encyclopedia In Microsoft Windows, resources are read-only data embedded in EXE, DLL, CPL or (beginning with Windows Vista) MUI files. The Windows API provides for easy access to all applications' resources. [edit]TypesEach resource has a type and a name, both being either numeric identifiers or strings. Windows has a set of predefined resource types: Cursor and animated cursorIconBitmapDialog box templateFontHTML documentString and message templateVersion data- So it seems that I cannot store a FILE in a resource. All I wish to do is make a simple installer that installs an .exe onto the user's hard disk. Thank you for the link, Mattias. It seems the page has been updated since I last saw it. This is the code for my installer so far:procedure TMainForm.InstallButtonClick(Sender: TObject);beginStatusMemo.Append('Attempting to retrive file...');CRes := LazarusResources.Find('test');StatusMemo.Append('test resource found.');{So what do I do here to get the .exe stored in the resource(Compiled with Lazres) and place it on the users hard disk?}... Do I have some mislead conception of a 'resource'?What comes next in the code?Thanks in advance,- JoshPS. Sorry for the repeated posts, I'm having time lag and I'm posting from a crappy device _ http://clk.atdmt.com/UKM/go/195013117/direct/01/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
On Sun, 25 Jul 2010 09:52:08 +0100 Josh Lee frozen-drago...@hotmail.com wrote: I am now very confused. I have been told by someone on Lazarus Forums that to write an installer, I would need to use Resources. I have done some research into resources, and got this:Resource (Windows)From Wikipedia, the free encyclopedia In Microsoft Windows, resources are read-only data embedded in EXE, DLL, CPL or (beginning with Windows Vista) MUI files. The Windows API provides for easy access to all applications' resources. [edit]TypesEach resource has a type and a name, both being either numeric identifiers or strings. Windows has a set of predefined resource types: Cursor and animated cursorIconBitmapDialog box templateFontHTML documentString and message templateVersion data- So it seems that I cannot store a FILE in a resource. All I wish to do is make a simple installer that installs an .exe onto the user's hard disk. Thank you for the link, Mattias. It seems the page has been updated since I last saw it. This is the code for my installer so far:procedure TMainForm.InstallButtonClick(Sender: TObject);beginStatusMemo.Append('Attempting to retrive file...');CRes := LazarusResources.Find('test');StatusMemo.Append('test resource found.');{So what do I do here to get the .exe stored in the resource(Compiled with Lazres) and place it on the users hard disk?}... If you followed the wiki page you now have the file in a string. Now save the string to a file and set the file attributes. Do I have some mislead conception of a 'resource'?What comes next in the code?Thanks in advance,- JoshPS. Sorry for the repeated posts, I'm having time lag and I'm posting from a crappy device Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
Josh Lee Programmer - Owner of JLSoftware On 25 Jul 2010, at 10:05 AM, Mattias Gaertner nc-gaert...@netcologne.de wrote: On Sun, 25 Jul 2010 09:52:08 +0100 Josh Lee frozen-drago...@hotmail.com wrote: I am now very confused. I have been told by someone on Lazarus Forums that to write an installer, I would need to use Resources. I have done some research into resources, and got this:Resource (Windows)From Wikipedia, the free encyclopedia In Microsoft Windows, resources are read-only data embedded in EXE, DLL, CPL or (beginning with Windows Vista) MUI files. The Windows API provides for easy access to all applications' resources. [edit]TypesEach resource has a type and a name, both being either numeric identifiers or strings. Windows has a set of predefined resource types: Cursor and animated cursorIconBitmapDialog box templateFontHTML documentString and message templateVersion data- So it seems that I cannot store a FILE in a resource. All I wish to do is make a simple installer that installs an .exe onto the user's hard disk. Thank you for the link, Mattias. It seems the page has been updated since I last saw it. This is the code for my installer so far:procedure TMainForm.InstallButtonClick(Sender: TObject);beginStatusMemo.Append('Attempting to retrive file...');CRes := LazarusResources.Find('test');StatusMemo.Append('test resource found.');{So what do I do here to get the .exe stored in the resource(Compiled with Lazres) and place it on the users hard disk?}... If you followed the wiki page you now have the file in a string. Now save the string to a file and set the file attributes. Do I have some mislead conception of a 'resource'?What comes next in the code?Thanks in advance,- JoshPS. Sorry for the repeated posts, I'm having time lag and I'm posting from a crappy device Mattias Right, so if I followed the Wiki, Data would contain a string? What would the string be? Can resources only contain one piece of data? What would saving a string to a file accomplish? I have only been writing in Lazarus for half a year, and have no expertise in file I/O. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
Josh Lee schrieb: Each resource has a type and a name, both being either numeric identifiers or strings. [...] So it seems that I cannot store a FILE in a resource. You can add files as User-Defined resource types, or use RCDATA for raw (binary) data. See MSDN Resource Definition Statements, User-Defined Resources. Please quote only the relevant parts of the original message. DoDi -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
You can add files as User-Defined resource types, or use RCDATA for raw (binary) data. See MSDN Resource Definition Statements, User-Defined ResourcesThank you, I read up on them.Do you know where I can find a step by step tutorial on how to create a stand alone program that installs something on the hard disk?Or sample code I can build up on?Thanks. Please quote only the relevant parts of the original message. Sorry.- Josh _ http://clk.atdmt.com/UKM/go/19780/direct/01/ We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now-- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
Josh Lee schrieb: Do you know where I can find a step by step tutorial on how to create a stand alone program that installs something on the hard disk? No sorry. Details depend on what you want to install (files only, registry settings...), if you want to add an uninstall option as well, etc. I don't know whether MS released according documentation, because they provide their own tools for that purpose - so they most probably describe only how to use these. Or sample code I can build up on? Some open source installer? DoDi -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Lazarus Resources
I know these look like spam, I'm not that familiar with mailing lists... Could someone please give me a description and documented code explaining on how Lazarus Resources works and how to use it to make a stand alone .exe that transfers files to the hard drive? I really need to know, as I wish to craft a simple installer. To clarify: I want to craft my OWN installer, not some installer building software. - Josh -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources (2)
On Tue, 20 Jul 2010 18:24:36 +0100 Josh Lee frozen-drago...@hotmail.com wrote: Hello people. I've managed to compile a Lazarus resource, test.lrs. It has cmd.exe in it (I think!), and I'm trying to make a (useless) stand-alone program that takes the cmd.exe from the resource and places it in C:\. I've tried, and failed, and the Lazarus wiki doesn't explain it very well. Could someone please supply some documented sample code that does this? http://wiki.lazarus.freepascal.org/Lazarus_Resources#Getting_the_raw_data_of_a_lrs_resource Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources (2)
John, I run Vista. Yes, there is error messages, I simply do not know the syntax to achieve it. - Josh -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources (2)
Josh Lee wrote: John, I run Vista. Yes, there is error messages, I simply do not know the syntax to achieve it. - Josh Oh well, as you can see error messages, you can type them here? John -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Lazarus Resources
Hey, people. I'm quite a novice Lazarus programmer, and I would like a bit of help, please. How do I use Lazarus resources? I think I know what they are, files that can be compiled into the binary? I'm not sure, but it was suggested to me when I asked how an installer works. Problem is, I can't find 'New Resource' in Lazarus, and I have no idea how to use it anyway. I Googled it but can't find it anywhere. I'm going to attempt to write an installer that installs a dummy .exe on the computer. Any help would be appreciated, - Josh -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources
You can compile it with GoRC.EXE (you can find it on FPC folder) and link it through the directive {$R resname.res} on your project. Antônio 2010/7/20 Josh Lee frozen-drago...@hotmail.com: Hey, people. I'm quite a novice Lazarus programmer, and I would like a bit of help, please. How do I use Lazarus resources? I think I know what they are, files that can be compiled into the binary? I'm not sure, but it was suggested to me when I asked how an installer works. Problem is, I can't find 'New Resource' in Lazarus, and I have no idea how to use it anyway. I Googled it but can't find it anywhere. I'm going to attempt to write an installer that installs a dummy .exe on the computer. Any help would be appreciated, - Josh -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Lazarus Resources (2)
Hello people. I've managed to compile a Lazarus resource, test.lrs. It has cmd.exe in it (I think!), and I'm trying to make a (useless) stand-alone program that takes the cmd.exe from the resource and places it in C:\. I've tried, and failed, and the Lazarus wiki doesn't explain it very well. Could someone please supply some documented sample code that does this? Thanks in advance, - Josh -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Resources (2)
Josh, I don't know much about resources, but: - What OS? In Win Vista or 7 you may not be allowed to write to C:\ - Is there an error message? John Josh Lee wrote: Hello people. I've managed to compile a Lazarus resource, test.lrs. It has cmd.exe in it (I think!), and I'm trying to make a (useless) stand-alone program that takes the cmd.exe from the resource and places it in C:\. I've tried, and failed, and the Lazarus wiki doesn't explain it very well. Could someone please supply some documented sample code that does this? Thanks in advance, - Josh -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus