Posted: 28 May 2020 11:52 EDT Last activity: 29 May 2020 13:26 EDT
StartMyDay - AllowLocalApplications
I am trying to add local applications programmatically using the StartMyDayManager.AddWebApplication method. I can see the applications in the Manage Applications dialog where you can enable/disable them. I also see in %appdata%\Pegasystems the StartMyDay-* file with the settings saved. The settings do not stick between runtime sessions unless I have AllLocalApplications set to True in the RuntimeConfig.xml file, which also adds a button the manage applications dialog to allow the user to Add local applications. I do not want the user to be able to add applications. Is there a way to keep the enabled/disabled settings without setting AllowLocalApplications to True?
I don't see a way around this without coding for it.
I would make a copy of the StartMyDay file whenever it is changed. The method has a result that lets you know if the user clicked OK (although you could really copy it even if they didn't change anything). When you load the project, you can then read the copied file and apply those settings to the applications as you add them back in. This would require you to know a little JSON to read the file or use the JSONUtils to help with that.
Another way would be to simply record the settings somewhere else and read them from the alternate place. After the user shows the dialog, you could then read the settings by iterating through the method GetStartupApplications and read the Enabled setting for the apps you need to record and reset. For saving things like this, I prefer to use the CredentialStore component as it creates the file for you and stores it for the current user only. When you save something to it, you just need to be sure to enter a value for the user and password (although when you read it back, you'd only care about one of those).