Jump to content
Stuart Clennett

Error during Execute in MARSCmd

Recommended Posts

Hi,

 

I tried creating a new project using MARScmd.   I entered the name of the project and selected the path (folder exists and is empty) and got "The specified path was not found".

 

I used madExcept to grab the bug-report (see below). 

 

Regards

Stuart

 

date/time          : 2018-11-30, 15:00:31, 35ms
computer name      : WIN8VM
user name          : stuart
registered owner   : stuart
operating system   : Windows 10 x64 build 17134
system language    : English
system up time     : 6 hours 7 minutes
program up time    : 46 seconds
processors         : 8x AMD Ryzen Threadripper 1920X 12-Core Processor
physical memory    : 18055/24575 MB (free/total)
free disk space    : (C:) 141.23 GB (D:) 6.44 GB
display mode       : 3072x1728, 32 bit
process id         : $3a8
allocated memory   : 81.02 MB
largest free block : 1.19 GB
executable         : MARScmd_VCL.exe
exec. date/time    : 2018-11-30 14:59
version            : 1.0.0.0
compiled with      : Delphi 10.1 Berlin
madExcept version  : 4.0.19
callstack crc      : $31e03340, $79de1760, $79de1760
exception number   : 1
exception class    : EDirectoryNotFoundException
exception message  : The specified path was not found.

main thread ($5f4):
0055ec43 +0cb MARScmd_VCL.exe System.IOUtils  2699  +12 TFile.InternalCheckFilePathParam
0055ea8e +00e MARScmd_VCL.exe System.IOUtils  1919   +2 TFile.CheckMoveParameters
0055ecfb +063 MARScmd_VCL.exe System.IOUtils  2711   +6 TFile.Move
0065da82 +12e MARScmd_VCL.exe MARS.Cmd         208  +10 TMARSCmd.ReplaceEverywhere
0065d3a4 +108 MARScmd_VCL.exe MARS.Cmd         139  +11 TMARSCmd.Execute
0066337d +029 MARScmd_VCL.exe Forms.Main        89   +1 TMainForm.ExecuteActionExecute
00531667 +00f MARScmd_VCL.exe System.Classes 16674   +3 TBasicAction.Execute
0057e4fa +086 MARScmd_VCL.exe Vcl.ActnList     260  +19 TCustomAction.Execute
005314d3 +013 MARScmd_VCL.exe System.Classes 16585   +2 TBasicActionLink.Execute
00597b94 +05c MARScmd_VCL.exe Vcl.Controls    7427   +7 TControl.Click
005af36e +01e MARScmd_VCL.exe Vcl.StdCtrls    5434   +3 TCustomButton.Click
005afe7c +010 MARScmd_VCL.exe Vcl.StdCtrls    5895   +1 TCustomButton.CNCommand
0059763e +2be MARScmd_VCL.exe Vcl.Controls    7313  +91 TControl.WndProc
0059c189 +5e9 MARScmd_VCL.exe Vcl.Controls   10143 +158 TWinControl.WndProc
005af018 +06c MARScmd_VCL.exe Vcl.StdCtrls    5271  +13 TButtonControl.WndProc
00597278 +024 MARScmd_VCL.exe Vcl.Controls    7091  +10 TControl.Perform
0059c2ef +023 MARScmd_VCL.exe Vcl.Controls   10212  +12 DoControlMsg
0059cd7b +00b MARScmd_VCL.exe Vcl.Controls   10487   +1 TWinControl.WMCommand
0059763e +2be MARScmd_VCL.exe Vcl.Controls    7313  +91 TControl.WndProc
0059c189 +5e9 MARScmd_VCL.exe Vcl.Controls   10143 +158 TWinControl.WndProc
0059b7a8 +02c MARScmd_VCL.exe Vcl.Controls    9850   +3 TWinControl.MainWndProc
005323c4 +014 MARScmd_VCL.exe System.Classes 17178   +8 StdWndProc
765ebc52 +132 user32.dll                                SendMessageW
765e7af8 +088 user32.dll                                CallWindowProcW
0059c29a +0e6 MARScmd_VCL.exe Vcl.Controls   10184  +30 TWinControl.DefaultHandler
00598000 +010 MARScmd_VCL.exe Vcl.Controls    7562   +1 TControl.WMLButtonUp
0059763e +2be MARScmd_VCL.exe Vcl.Controls    7313  +91 TControl.WndProc
0059c189 +5e9 MARScmd_VCL.exe Vcl.Controls   10143 +158 TWinControl.WndProc
005af018 +06c MARScmd_VCL.exe Vcl.StdCtrls    5271  +13 TButtonControl.WndProc
0059b7a8 +02c MARScmd_VCL.exe Vcl.Controls    9850   +3 TWinControl.MainWndProc
005323c4 +014 MARScmd_VCL.exe System.Classes 17178   +8 StdWndProc
76607a7b +00b user32.dll                                DispatchMessageW
00646d5f +0f3 MARScmd_VCL.exe Vcl.Forms      10534  +23 TApplication.ProcessMessage
00646da2 +00a MARScmd_VCL.exe Vcl.Forms      10564   +1 TApplication.HandleMessage
006470d5 +0c9 MARScmd_VCL.exe Vcl.Forms      10702  +26 TApplication.Run
0066c905 +049 MARScmd_VCL.exe MARScmd_VCL       18   +4 initialization
74818482 +022 KERNEL32.DLL                              BaseThreadInitThunk

 

Share this post


Link to post

Weird...

Let's assume you checked out MARS in a certain folder "MARS_BASE" (mine is 'C:\Sviluppo\Librerie\MARS').

You should have MARSCmd executable in MARS_BASE\Utils\Bin\Win32

Once you ran it, it should detect MARS base folder (it's printed in the bottom left part of the MARSCmd window) and suggest you to clone MARSTemplate from MARS_BASE\Demos\MARSTemplate, when you click Next, you should be able to change the "Replace With" value with the name of your new project, then click Next again and you should see the Destination folder valued to something like MARS_BASE\Demos\NAME_OF_YOUR_PROJECT

 

I can see from your bug report that you are using Berlin as I am in this exact moment so I actually don't understand what's going wrong.

 

Let me know please

Sincerely

Share this post


Link to post

HI Andrea,

 

The base path detected is correct:   D:\Components\MARS\

 

The executable is in D:\Components\MARS\Utils\Bin\Win32

 

The template suggested is D:\Components\MARS\Demos\MARSTemplate

 

I set the "replace to" as OC2

 

The "Execute" page shows D:\Components\MARS\Demos\OC2

 

I press Execute button and I get the above error.   If you'd like me to debug further please let me know what you'd like to do.

 

Thanks very much


Stuart

Share this post


Link to post

I really can't think what's going wrong...

I recorded a short video, would you please try to step through it and see if something differs from what you are doing?

 

Link: 

 

 

Would you try a different output path for your project? (to see if there something to do with privileges on file system?) 

If you like, we can have a remote session (Teamviewer or similar) to check it out together.

 

Thanks for your patience

Share this post


Link to post

Hi Andrea,

 

I followed the initial clone and installation procedure as per your video.

 

I am also following the same procedure as you when creating the new project via MARSCmd.

 

I will try stepping through the code and see what I can find that way and report back to you.  (It's very busy around here at the moment, so it may take a day or so for me to get around to.. so please bear with me - thanks)

 

Best wishes,

 

Stuart

  • Thanks 1

Share this post


Link to post

Hi Andrea,

 

It appears the problem is in the TMARSCmd.ReplaceEverywhere method.  Specifically the following line:

 

      if LNewFileName <> LFile then
        TFile.Move(LFile, LNewFileName);

When the files are originally copied from the MARSTemplateClient\Bin folder the sub-folder name of "MARSTemplateClient" is not changed.   So in the case of the target folder being %MARS%\Demos\OC2,  the AndroidManifest.xml file is copied to %MARS%\Demos\OC2\bin\MARSTemplateClient\AndroidManifest,xml.  

 

When the ReplaceEverywhere routine runs the LNewFilename variable becomes %MARS%\Demos\OC2\bin\OC2\AndroidManifest,xml.   This folder does not exist and so I'm encountering an error.

 

I've patched it to get it working quickly by adding a ForceDirectories call before the TFile.Move - which works but leaves behind an empty folder structure OC2\bin\MARSTemplateClient .  So I guess the original Execute procedure where it copies files maybe needs a little work ??

 


Regards

 

Stuart

 

(PS - I really like MARS - it's serving my first "proper" mobile app and it's acting as a microservice in a large enterprise desktop app too - thanks)

 

 

Share this post


Link to post

Thanks for figuring this out!

I would say you should not have that file there (as it is not there in the repo https://github.com/andrea-magni/MARS/tree/master/Demos/MARSTemplate/bin ). You probably have it because you actually compiled MARSTemplate demo itself (did you?)...

However it is obviously a fault of my strategy to rename files... I will try to improve (probably managing a list of files to rename and the expected final name and then have a much smarter copy strategy).

 

Thanks again for taking the time to spot it and make it evident.

I have added an issue on GitHub: https://github.com/andrea-magni/MARS/issues/52

 

Sincerely,

Andrea

Edited by Andrea Magni

Share this post


Link to post

HI Andrea,

 

You're welcome - thanks for the great library 🙂

 

Yes, that makes sense, I will clean the MARSTemplate project.

 

Kind regards

Stuart

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×