Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectionsList.xml denied for installed applications #10

Closed
rappen opened this issue Apr 5, 2016 · 5 comments
Closed

ConnectionsList.xml denied for installed applications #10

rappen opened this issue Apr 5, 2016 · 5 comments

Comments

@rappen
Copy link

rappen commented Apr 5, 2016

When using McTools.Xrm.Connection.dll version 1.2016.3.29 with a program installed using msi installer, it is not possible to access the MscrmTools.ConnectionsList.xml file.
Starting the connection selector dialog displays this:

image

Error details:
System.Exception: Error while serializing: Access to path C:\Program Files\Cinteros AB\Cinteros CRM Deployer\MscrmTools.ConnectionsList.xml is denied. vid McTools.Xrm.Connection.XmlSerializerHelper.SerializeToFile(Object o, String path) vid McTools.Xrm.Connection.ConnectionsList.Save() vid McTools.Xrm.Connection.WinForms.ConnectionSelector.tscbbConnectionsFile_SelectedIndexChanged(Object sender, EventArgs e)

Related to #2.

@MscrmTools
Copy link
Owner

I guess this problem is more a security access. I guess your installer should handle the possibility to access the folder with read/write privileges

@rappen
Copy link
Author

rappen commented Apr 5, 2016

It definitely is a security issue, as users normally don't have write access to Program Files folders where applications are installed.
That is why I introduced the possibility to use an alternate path for the Connections in PR MscrmTools/XrmToolBox#262
This makes it possible to have applications working "properly" with storage under AppData instead of Program Files folder.
Perhaps it could be implemented so that if a specific path to the connection file is given, it will not try to write connectionlist file from current folder?
And some fault tolerance when writing the connectionlist file, så that it will simply not be written if not allowed?
If you accept these suggestions, I can try to create a PR for it.

@MscrmTools
Copy link
Owner

Back to the connection project. Ready to receive a PR on this subject

@MscrmTools
Copy link
Owner

@rappen ping :)

@MscrmTools
Copy link
Owner

No need for a PR, I finally understood what you were looking for :)

I added a static property ConnectionsListFilePath in singleton ConnectionsList so that you can tell the connection controls to store the connections list to a specific file. If the file does not exists, it is created with a default connections file.

ConnectionsList.ConnectionsListFilePath = "c:\\Temp\\test_local_connectionsList.xml";
ConnectionManager.ConfigurationFile = "BlaBla.xml";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants