Run .exe by MATLAB - License error - matlab

I need to Run a .exe in a MATLAB project which changes some parameters in a txt file. I wrote:
system('C:\path\to\Program1.exe')
but it doesn't work and the error shown is:
Program1 ERROR: License not detected!
The program is correctly installed with license and it works, if I open the application. The license txt file is in the same folder as the .exe file.
What is the problem? Is the source code necessary?

Related

How to call an executable with Dll from a directory without this dll

I have a working directory a and
I have a directory b with an exutable and a dll which is used by the executable.
I want to launch the executable in the working directory.
With powershell I do that:
$env::path += ";C:\path\to\the\directory b"
Now I try to launch the executable from directory a
executableName
the programm is launched but it fails to work because it can't find the dll.
How can I fix the problem?
I have contacted the company that has done this executable file.
The problem comes from the file.
It's not a path related problem.

MATLAB: Create a .dll from .c file

I have no MATLAB experience. I inherited a piece of Labview code that uses a Matlab complied .dll
Problem is the .dll had a memory leak that I was able to detect and remove.
Now I have no idea how to recompile the c File to produce the .dll file.
The c file has a comment that I believe relates to how the file must be compiled, see below:-
// MATLAB Compiler: 4.3 (R14SP3)
//Arguments: "-B" "macro_default" "link:lib" "reverse_wrapper.m"
The c File is in a folder that has a number of other files including ranging from .dll .m .exports and .m files
Searching the development PC, I see MATLAB Component Runtime version 7.3 is installed.
Please help me with a detailed step by step procedure to get compile my .c file into a .dll do I need to download a compiler and other tools?
https://drive.google.com/drive/folders/1NMV07uslBJey0wlkzthO2krmY5g1BWWQ?usp=sharing
in the above file there is folder named complier, I wonder if this is useful.

Build Rule project(ODM) with the Build Command Line

I am trying to find a way to build Ruleapp.jar from command line and going through this link, and found a command.
java -jar Build_Command_Line_executable_archive -config configuration_file
Trying to figure out what "Build_Command_Line_executable_archive" is and from where I can get this jar to execute the above command
The "Build_Command_Line_executable_archive" is a jar file that comes with ODM. You should be able to find it with the other ODM installation files. On my computer, this file is at:
C:\IBM\ODM89\buildcommand\rules-compiler\rules-compiler.jar
Note: In v8.9.1, there is a defect in the build command tool that causes the RuleApp archive that is generated to include the file "META-INF/archive.xml" that contains 'resuri' instead of 'reslib'. You have to manually edit this file in the RuleApp archive to fix it or write a script to do it for you.

Adding a Library to the Library Browser

I have a difficulty. I can not add a library "FOTS Simulator" to the Simulink Library Browser in MATLAB.
I was reading the site "https://www.goddardconsulting.ca/simulink-creating-custom-libraries.html" but I cannot reproduce their result.
In my computer I have installed MATLAB in :
C:\Program Files\MATLAB\MATLAB Production Server\R2015a
And I created a "FOTS Simulator" folder. In this folder are several files, including "Slblocks". So this file is in:
C:\Program Files\MATLAB\MATLAB Production Server\R2015a\toolbox\FOTS Simulator
I ran slblock.m in a directory that is on the MATLAB path. However, I wrote Browser.Library = 'FOTS_2015a' (as you can see in the code below).
It should be noted that this file (FOTS_2015a) is in .slx format in :
C:\Program Files\MATLAB\MATLAB Production Server\R2015a\toolbox\FOTS Simulator
How do I make "FOTS Simulator" appear in the Library Browser?
Code:
function BlkStruct = slblocks
BlkStruct.Name = sprintf('FOTS Simulator')
Browser.IsFlat = 1;
BlkStruct.OpenFcn = 'FOTS_2015a'
Browser.Library = 'FOTS_2015a';
BlkStruct.MaskDisplay = ''
Browser.Name = 'FOTS Simulator';
% 'OFTS Simulator' is the library name that appears in the Library Browser
BlkStruct.Browser = Browser;
end
Many of the following steps are over-kill and not required, nonetheless I would suggest doing the following:
Close MATLAB
Start MATLAB
Remove your directory from the MATLAB path, saving the change so that it is permanently removed.
Close MATLAB
move or rename your slbocks.m file (so that effectively slblocks.m for your custom library doesn't exist)
Start MATLAB (do not cd into your directory)
Try to open your custom Simulink library by typing its name at the MATLAB command line. This should generate an error saying the library cannot be found. If the library can be found then go back to step 3.
Add your directory to the MATLAB path, saving the change so that it is permanently on the path.
Try to open your custom Simulink library by typing its name at the MATLAB command line. This should open your library. If it doesn't then for some reason MATLAB is not finding your library.
Close MATLAB
create slblocks.m for your custom library putting it in your directory
Start MATLAB
Start Simulink (by opening a model or creating one from scratch)
Open the Simulink Library browser
Your custom library should appear in the list of available libraries.

dump reader can't find symbol files

I'm trying to learn about reading dump files, so I made my small APP crush, and created a dump for that process from task manager.
I tried to open the .dmp file, both from VS10 and windbg.exe, and got an error that the symbol files are missing. I specified the path of the symbol files as the directory where the .pdb files are located :
..\Visual Studio 2010\Projects\CachedQueryTester\CachedQueryTester\bin\Debug
but I still get the same error, both on VS10 and windbg.exe,
Any Idea?
You may also need symbols from Microsoft , try to enter
0:000> .symfix
in windbg
From your configuration, you should not have to specify any debug symbol path, because the path of your symbols are stored in the executable. To be sure, you can open a Visual Studio Command prompt and type
dumpbin CachedQueryTester.exe /HEADERS
In the output, you should have a 'Debug Directories' entry containing the full path of the pdb.
If this is not the case, check you have specified to generate a PDB file (Configuration Properties / Linker / Debugging / Generate debug info);
You can also try to ask WinDbg for the location it looks for. In order to do this, open your dump file from within WinDbg, type '!symnoisy' and reload the symbols (.reload /u then .reload and kb). It will tell you the locations it looks for.