How to verify, that Ensemble instance is already installed by using ccontrol?
Hello,
as you can see in title my problem is with file ccontrol. I want to install whole Ensemble with Manifest if on machine wouldn't be any, or if I somehow find out instance of Ensemble I want to only use settings from included Manifest. I read that I can use file ccontrol to solve this task.
So can someone said me, how to work with ccontrol, is there some variable or function which returns me somethig? I have read some parts of documentation about ccontrol, but nothing help me so much, so you can give me link to part in documentation, where is this desribed.
My easy solution coud be, that I use ccontrol list which returns me information about installed instance, if the instance isn't on machine it will return error, which I verify in if condition, this maybe coud work, but I think/hope that there must be some better solution.
So thank you for your answers.
Zdeněk
Use ccontrol qlist to get structured information about available instances.
ccontrol qlist [<instance>] [nodisplay > outputfile]
Display a quick list of information about all installed instances, in a format suitable for parsing in command scripts.
The record for an instance contains fields separated by "^" (carats):
Ok thank you I've got it, but I've got here something else, if I do this verify and result will be, that Ensemble is installed, how can I start only Manifest, my idea was, that I could invoke Ensemble terminal by ccontrol, and somehow type here commands, but is there any possibyllity how can I do this only from cmd, without typing by my hands?
Thank you, I'm so grateful to you.
Sure
Script contains code you want to execute, in your case the call to installer manifest. It could be a file or just the code itself.
Example.
A series of articles about automating CI/CD.
Ok finally I try to put there this line of code do ##class(User.Installer).setup() but as you can guess it doesn't working, According to documentation it should be COS code is that right? Then I tried put there Installer file, but it's .xml it must be rouitne or not?
I'm appologise, that I restrain you, but I started recently and I'm not completely friend with Ensemble.
Again thank you for your time.
First two lines of your script should probably be user and password, unless you're running a minimal security install or enabled OS authentication.
ObjectScript code after that, yes, sothis looks correct
Maybe you need to load User.Installer beforehand?
Use $system.OBJ.Load(file, "c") to load and compile class(es) you need.
I've got minimal security settings, but it wouldn't be bad put there some security and try it with username and password. I can use this method rightLogin(Username As %String , Password As %String )?
This returns me syntax error.. Do $system.OBJ.Load("Installer.xml", "c") I dont know why.
Then you don't need to provide user and password.
No. First line of script - user, second line - password. After that - ObjectScript.
Try full path. Also this method returns status, check it:
Ok
In terminal it's working fine, but in my .cmd script no. If i run this:
csession Cache -U%SYS do $system.OBJ.Load("C:\Users\Zdenda\Desktop\install\Installer.xml", "c")
It return an error like this:
You need to either escape your command or use a separate file for a script. I recommend a file.
What type of script it should be? Another .cmd or which one please?
ObjectScript script I guess. Just a file with ObjectScript commands.
Here's a sample.
Ok thanks, I've got it, but still the same error Invallid arguments...
Well, show your cmd script (as text) and ObjectScript script.
In .cmd file is this:
@ECHO OFF
cd /
cd InterSystems\bin
type NUL > file.txt
ccontrol qlist Cache nodisplay > file.txt
set instance = ""
FOR /F "tokens=1 delims=^" %%x in (file.txt) DO set instance=%%x
echo %instance%
IF "%instance%" NEQ "" (
csession Cache -U%SYS < C:\Users\Zdenda\Desktop\run.script
) ELSE (
Echo Somenthing goes wrong with error number %ERRORLEVEL%.
)
del file.txt
::FOR /F "tokens=1 delims=^" %%x in (file.txt) DO echo %%x
Pause
And in file run.script is this code:
Do $system.OBJ.Load("C:\Users\Zdenda\Desktop\install\Installer.xml", "c")
Do ##class(User.Installer).setup()
I really don't know why.. Thanks a lot..
Try
With this result..
I suggest you contact the WRC for this problem.
I think the problem is in the command escaping.
So ok I'll try, thank you for your time, I'm so much grateful.
After long thinking and reading some documentation, I'm maybe closer to solve this problem.
I stardet using ccotrol and by this commad I started terminal where I'm trying to invoke some code.
It looks like this:
.png)
But as you can see terminal returns me Access Denied. I don't know why.. I've installed Ensemble with minimal security parameters.
Is this information or porgress somehow helpful for you, can you now give me some advices how to do this?
Thanks again!
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue