Qt Creator: Run command before running executable?
-
wrote on 12 Jul 2023, 08:54 last edited by
I'd like to run a command (basically deleting a file) every time before I start a certain executable from Qt Creator (Run, not necessarily debug).
Is this possible with Qt Creator?
-
I'd like to run a command (basically deleting a file) every time before I start a certain executable from Qt Creator (Run, not necessarily debug).
Is this possible with Qt Creator?
wrote on 12 Jul 2023, 11:19 last edited by@Asperamanca
I don't see where Creator allows a "pre-run" command, that would be nice.Can you utilise Specifying a Custom Executable to Run to perhaps execute a little script which deletes the file and then runs the real executable?
-
@Asperamanca
I don't see where Creator allows a "pre-run" command, that would be nice.Can you utilise Specifying a Custom Executable to Run to perhaps execute a little script which deletes the file and then runs the real executable?
wrote on 12 Jul 2023, 11:39 last edited by@JonB
Thanks! It means a couple of extra clicks, but is still much faster than the alternatives I have used so far.
Thanks! -
-
@JonB
Thanks! It means a couple of extra clicks, but is still much faster than the alternatives I have used so far.
Thanks!wrote on 12 Jul 2023, 11:44 last edited by@Asperamanca
An alternative might be to make your executable code itself delete such a file as the very first thing it does? You might even do that only if compiled with a certain#define
/command-line argument/environment variable setting? -
I'd like to run a command (basically deleting a file) every time before I start a certain executable from Qt Creator (Run, not necessarily debug).
Is this possible with Qt Creator?
@Asperamanca said in Qt Creator: Run command before running executable?:
basically deleting a file
What is that file? Is this a build artefact generated during the build?
-
@Asperamanca said in Qt Creator: Run command before running executable?:
basically deleting a file
What is that file? Is this a build artefact generated during the build?
wrote on 12 Jul 2023, 12:35 last edited by@jsulm
In my case it's a file that the executable tries to parse, but fails. It's a bug, but it's another person's code, so I'd rather not change the code until it's properly fixed.
1/6