How to programmatically request and release a feature license in Dymola - modelica

I am wondering if there are commands to programmatically obtain and release shared licenses (libraries, binary export license etc.) for Dymola 2020x without having to shut down the entire program.
I am specifically interested in being able to obtain and release the code export License. I have tried these two options, but haven't had much success reliably releasing a license or obtaining a recently freed license (by another user) without having to close Dymola.
DymolaCommands.Others.RequestOption()
Advanced.EnableCodeExport

Regarding obtaining a license; I have been able pull a shared license with the following code:
RequestOption("BinaryModelExport")
This only works if the license is not checked out by another user. Note it takes about 5 minutes to obtain the license when it has been "freed" by another user.
However I have had no success in pragmatically releasing the license after. I would love to be able to do this.

Related

How to stop antivirus false positives everytime we re-release software?

Windows Defender and AVG/Avast pickup our software application as a virus/false positive everytime we release. We have a code signing certificate and add taggant as well.
Every time we release the software we have to go through the process of doing a false positive form on multiple AV vendors sites.
How can we get our company code signing cert marked as safe or avoid this time consuming false positive report process on each release?
Edit: Is there any premiere support we can pay for to have this done automatically?
Edit2: we actually had our certificate revoked due to "malware distribution" as a result of these false positives. It seems there is no recourse other than to buy another one.
Signing cert doesn't help most of the time, it's probably a coding pattern which is similar to a virus listed in them, best you can do is contacting the AV to whitelist you to get past through that.
My recommendation is to contact with the AV vendors and told them your problem. Probably your software have some strings or patters defined that potentially trigger the heuristics of the AV. You can try to find that strings easily in your base code and base64/xor/encrypt them and see what happens with the AV, that may help to solve your problem
While it is certainly possible that your software shares some characteristics with know malware, I would guess that it is a "cloud" detection.
Cutting through the marketing speak, it basically means that (among other possible caues) your file is flagged as suspicious if it has not been seen on many other PCs.
Try removing any thing that could activate antivirus flags, like self-extracting, UPX, file encryption, suspicious website requests, or suspicious behaviour.
Why to remove these?
self-extracting is triggered because it's a suspicious behaviour (not really normal to do)
UPX is detected as some malwares try to hide the malware by being compressed by UPX, as antiviruses need to decompress it.
File encryption may be easily detected as Riskware / EncoderTool / Ransomware
Suspicious websites: Evit downloading files from strange URL.
I had this problem with a program auto-update, an antivirus detected it as a TrojanDownloader.
If your program doesn't do any of these things, I can't help you more, as that is a problem that the programmer community has.
I wish that could help

Matlab: Run code while preventing user intervention

I have a business-critical process implemented in Matlab. It is basically a script that will be called once per day, and results will be used to make business-critical decisions. I need to make sure that the results that are generated by the script are reliable in a business-sense, i.e. it needs to be revision-proof. We have a proper release process, so a release manager is the only one with write-rights to the production code environment.
Since Matlab is an interpreted language, a user could at any point of the execution of the approved code just press Ctrl+C to cancel execution, modify data, and coninue execution. For my results' paper trail I need to prevent that from happening.
The programs purpose is to generate financial and economic indicators from various data sources, which are saved and used to assist decision making investment decisions in a financial institution. Thus, the users are the developers, and any kind of modification as described above can be assumed to be non-malicious. The results just must be revision proof. We are a team of three researchers / fund managers, and by regulation are required to have some process in place, but no specifics, and obviously we would primarily get work done.
My current idea is as follows: Have a change manager role whos task it will be to test and approve newly developed code to the production environment. The production environment is neither readable nor writable and contains all relevant matlab scripts and code, as well as config files. A neither readable nor writable, but executable script will start the Matlab interpreter and our main program with another user with elevated access to the production directory. Results will be saved (using the elevated rights of that specific user) in a kind of 'append only' folder. Then the program will exit.
Is this an acceptable way of implementing things? What would be things to consider that I forgot? Alternative approaches?
Thank you!

Bittorrent sync approval process not working properly

I created a link to share a folder, deselecting the option that peers I invite must be approved on this device.
The other person used the link, and received a message that the "Sender needs to approve access to this folder based on these identity details".
My bittorrent sync window isn't showing me anything to indicate that someone is waiting on approval. I've never shared a folder via a link before (always just used keys directly on previous versions), so I have no idea how the program is supposed to prompt me for approval, and I can't find any documentation indicating how this prompt would be provided.
So there seem to be two problems here:
1. Even though I said the link doesn't require approval, they are being told that it does.
2. I don't have any way to approve it.
What's going on here? How do I fix this?
Thanks.
The most common cause of this is one of the systems having clock time out of sync too much, usually resetting your computers time using an online time server resolves it.

How can I find the number of concurrent uses of my app on Citrix?

Is there a way under Citrix for my application to make a call to the Citrix host to find out how many copies of my application are presently running? We want to limit this in our license and we need to have a way to verify it in the code.
thanks - dave
No, Citrix XenApp (which is their best-known product and probably the one you are asking about) does not offer any APIs or services that can be used for application license checking.
The closest you could get via Citrix is to use the Powershell SDK and call Get-XASessionProcess to get a process list. The problem with this approach is you need to be a Citrix admin, and it's a fairly round about way of doing this.
If I wanted to implemented a simple concurrent limit for license enforcement I would look at two options:
Implement a simple web-service somewhere that my app talks to, to get a license.
Create a simple Windows service that tracks processes to maintain a count of concurrent instances of your app. When the configured license count is exceeded you could set a flag in a shared memory section in the global namespace. Then in your app you check this flag at startup and exit immediately when it is set.
You could track processes using WMI, e.g.
http://weblogs.asp.net/whaggard/archive/2006/02/11/438006.aspx

Automatically triggering merge activity after remote on-site (custom) development?

In our office, the software we create is sent to our client's office along with an engineer and a laptop. They modify the code at the customer site, based on the customer requests, and deploy the exe.
When the engineer returns to the office, the changed/latest code is not updated to the server, thereby causing us all sorts of problems in the source code on the development boxes and laptops.
I tried to use a version control system like svn, but sometimes the engineer forgets to update the latest code to the svn server. Is there an automatic way that when the laptop connects to the domain, the version control system should automatically check for changes and prompt the user to update the code on the server, or automatically update the code to the server.
I think that the key to this is to require the on-site engineers to use a VCS at the customer site, and to make it a condition of their continued employment that the code at the customer site is in fact reloaded into the VCS on return to the office. You could say that the engineers sent on-site need to be trained in their duties, and they should be held accountable for not doing the complete job - the job isn't finished until the paperwork is done (where 'paperwork' in this context includes updating the source repositories with the customer's custom adaptations of the software).
It seems to me that it might be better to use a DVCS such as Git or Mercurial rather than SVN in this context. However, you should be able to work with SVN if the laptop dispatched to the server has a suitable working copy created for the customization work.
That said, the question is "can we make this easier and more nearly automatic". In part, that might depend on your infrastructure - it also might depend on Windows capabilities about which I'm clueless. There might be a way to get a particular program to run when the laptop connects to a new domain. An alternative (Unix-ish) approach would be to use some regularly scheduled job that runs, say, every hour and looks to see whether it is on the home domain and whether there are changes that should be submitted to the main repository.