Renaming Lazarus project? lazarus / 9-Editor ---------------------------------------------------------------------- Wodzu · 2010-01-28 20:03 I've created new Lazarus project, I've called it "BasicMovement". I ma having 4 files in the project location: BasicMovement.ico BasicMovement.lpi BasicMovement.lpr BasicMovement.res But I made a mistake and I would to change its name. Is there somewhere an option to rename my project to a given name? ---------------------------------------------------------------------- theo · 2010-01-28 20:24 Quote from: Wodzu on January 28, 2010, 09:03:18 pmIs there somewhere an option to rename my project to a given name? Save project as? ---------------------------------------------------------------------- Wodzu · 2010-05-04 05:46 Yeah, but that does nto autodelete older files ;-) Sorry for the double post BTW, I must have forgotten that I've already asked this question ---------------------------------------------------------------------- T-bear · 2010-06-23 23:59 Open windows explorer, go to the folder, and the rename each of the files. Note: You should not have any of the files open at the time. Then you cant rename it. ---------------------------------------------------------------------- TheSteven · 2010-07-11 19:25 I don't have a "Save Project As" in my version of Lazarus. I tried renaming the files in Windows Explorer and corrupted my project (lucky I made a backup first)! What did work is: Open your project in Lazarus i.e. the LPR file.If you have multiple pages open - click on the LPR file pane so that it is the one with focusGo under the File menu and select Save AsGive your project its new name AND change the file extension to "LPR"Click SaveThis will rename your project and its related files (*.lpi,*.rc, *.res,*.ico, etc.). Important Notes: * Backup your project first. * You must change the project file extension to "LPR" (not case sensitive, shown here in uppercase to prevent confusion) If you forget to change the extension you probably wont be able to reopen the project. * When you recompile you will have to manually clean out various files that used the old project name. ...Steven ---------------------------------------------------------------------- qoxop · 2011-10-21 05:36 Thanks Steven! It is somehow tricky, but your hint works. I wonder why there is NO menu item for project renaming, bacause it seems to me, this functionality is already implemented. Lazarus automatically rename and correctly change (!) content of all required files. e.g.  [*.lpi, *.res, *.ico] ---------------------------------------------------------------------- Zoran · 2011-10-21 09:53 Quote from: TheSteven on July 11, 2010, 09:25:31 pmI don't have a "Save Project As" in my version of Lazarus. I'm sure that actually you do, but you probably didn't find it. It's in main menu, under "Project". Quote from: qoxop on October 21, 2011, 07:36:34 amThanks Steven! It is somehow tricky, but your hint works. I wonder why there is NO menu item for project renaming, bacause it seems to me, this functionality is already implemented. Lazarus automatically rename and correctly change (!) content of all required files. e.g.  [*.lpi, *.res, *.ico] There is menu item "Project->Save Project As...". Save the project in same location, then delete files with old project name manually. Do not save the project in some other folder, then you will get only project file in new location, but units will not be copied there. Okay, it is a nice idea to have "rename project" item which will save project with new name in same folder and delete the files with old project name, but the procedure I just have described in previous sentence is pretty simple and... How often do you need to do this? ---------------------------------------------------------------------- User137 · 2011-10-21 10:07 Quote from: Zoran on October 21, 2011, 11:53:59 amThere is menu item "Project->Save Project As...". Save the project in same location, then delete files with old project name manually. Do not save the project in some other folder, then you will get only project file in new location, but units will not be copied there.That works and how i've done it. Simply going and renaming all the files could be trouble. For example, open your project .lpi file. You will see there are references to the project name that you'd have to change aswell. Also you might accidentally mispell one of the files and it'd bring chaos ---------------------------------------------------------------------- picstart · 2011-10-21 20:52 There is also publish project under the project tab. It moves a copy to a folder of your choosing. If it all works you can delete the original folder. ---------------------------------------------------------------------- Vos · 2012-04-01 10:17 Rename a Project in Lazarus. I found several ways to change a projectname in Lazarus. I did not succeed in using them. I use the following: Be sure the following files are present: Projectname.lpr which contains the Application Initialize. Unitnumber.lfm which contains the height, width etc of the form. Unitnumber.pas which contains your coding. I acted as follows: Rename (in Windows) all 3 files. As far as I know there is no restriction for the new name but keep the   .lpr,  .lfm and  .pas extensions. Then also change within the .pas file the old projectname into your new projectname. In Lazarus open the renamed .lpr file en then choose application. In the program you still will find after Interfaces the old unitname; change this into your new unitname. Still there are 2 problems. First change via Project Options/path/target filename the old projectname into your new projectname. Second remove via Project Options/link the option –wg to prevent error 103. I hope this works fine for you. At least it does for me. ---------------------------------------------------------------------- itsols · 2013-08-05 12:47 I'm using Lazarus 1.0.10 on Ubuntu 12.04. I tried a few times to save as a different name but my program did not work. It compiles and goes into linking and that's it. Then I tried doing it again and it got the Lazarus IDE freezing. Finally I could not even close Lazarus (i.e., force quit). But what worked for me was to simply rename the LPR file of the project.