Closed GoogleCodeExporter closed 9 years ago
Original comment by benoit.m...@gmail.com
on 13 Sep 2012 at 9:05
If the executable is generated inside the project directory (the default), then
the path is relative. So there is no need to change it when saving the project
with another name.
Otherwise, the executable path is absolute. Then what should be the new path?
Do you mean just replacing the old project name by the new project name inside
the path?
Original comment by benoit.m...@gmail.com
on 14 Sep 2012 at 11:59
OK.
1) This depends on the original project (let's call it "Orig") having an entry
in its .project file "ExecPath=". (Say, by someone using Make Executable and
changing the output directory in FMakeExecutable to somewhere other than the
"Orig" project directory.)
2) When someone opens "Orig" after that and makes a copy of the project as say
"NewProj", the "Orig" .project file is copied into the "NewProj" directory as
is. (That is, it contains the ExecPath= entry.)
3) When the new project is opened (automatically or otherwise),
Project.ReadProject() at line 3172 encounters that entry and sets
Project.ExecPath to its value.
4) Now we move to Project.MakeExecutable() around lines 2760-2765.
sExecPath = GetExecPath() <--- (a)
If Not Exist(File.Dir(sExecPath)) Then sExecPath = Project.Dir &/ File.Name(sExecPath)
'IF Dialog.SaveFile() THEN RETURN TRUE
sExecPath = FMakeExecutable.Run(sExecPath) <--- (b)
(a) getExecPath will return the value of Project.ExecPath, which can be a valid
and existing path, but the one where the "Orig" project was compiled in step 1
so (finally!) at (b) instead of the FMakeExecutable FileChooser ("fchExec")
pointing to the "NewProj" directory it is pointing to where "Orig" was compiled
and the file name is the original name.
What actually happened here was that Felicity compiled the "orig" project,
which is a boilerplate project to a shared testing directory on our source
server, I then made a copy of it as a new project. When I compiled the new
one, I didn't look at the FMakeExecutable form too closely, expecting that it
would just compile it into my new project directory. I then opened a terminal
using Tools|Open A Terminal and there was no executable there. Much confusion
then occurred because I couldn't find my executable and Felicity's version
magically changed!
So, to answer your question, I feel that the ExecPath= entry in the old
.project should not be copied into the new .project file. This is based on
considering the possible reasons for making a copy of a project, all the ones
that I can think of relate to the idea of copying the source for some other
purpose and none include retaining information about where the original project
was compiled to.
Sorry the original issue description was incomplete, it seemed so obvious to me.
B
Original comment by adamn...@gmail.com
on 15 Sep 2012 at 1:37
OK, got it :-)
Original comment by benoit.m...@gmail.com
on 17 Sep 2012 at 1:18
Fixed in revision #5172.
Original comment by benoit.m...@gmail.com
on 17 Sep 2012 at 1:42
Original issue reported on code.google.com by
adamn...@gmail.com
on 13 Sep 2012 at 3:42