Solved

What is the ProgramData/Zemax Folder for?


Userlevel 1

Can anyone tell me what the C:/ProgramData/Zemax folder is used for?  It seems to have duplicates of all the folders in the Users Documents Zemax folder.  It is not a left over from an old install because to get rid of all the clutter from 7 years of updates I have just resorted to a clean install and I deleted it as it was left behind after uninstalling Zemax.  After a clean install it has appeared again! Also apparently every time you do an update Zemax has to copy data over to it but it seems to just be clutter taking up hard disk space. 


That is not the only needless duplication, there are three locations you could put a DLL, there is a DLL folder in the aforementioned ProgramData/Zemax folder, there is another in Program Files/Zemax OpticStudio and yet another in the Users/Documents/Zemax folder.  Why does Zemax need to have three of them?  It is confusing to say the least and needless duplication is just plane bad programming!


Andrew

icon

Best answer by Angel Morales 9 July 2020, 18:52

View original

4 replies

Userlevel 4
Badge +1

Hi Andrew,


Thanks for your questions here. The 'C:/ProgramData/Zemax' folder is where all the Zemax-provided files are stored before being copied over into the 'C:/Users/.../Zemax' folder (which is where OpticStudio reads files from by default). I believe that on most PCs, this 'ProgramData' folder is hidden by default and must be set visible by the user. Actually, we generally don't recommend modifying the files in the ProgramData folder at all, though we have occasionally leveraged the ProgramData folder in various support cases to recover things like default catalogs, sample files, and more without a full re-install when a user might have modified/deleted those items for some reason.


In order to add files that OpticStudio can see and utilize, you will want to add them to the respective file paths as defined in Project Preferences...Folders tab:



So, for adding a DLL, you will want to place it in the DLL folder that is defined within your Data file path. Adding the DLL elsewhere will not make it visible to your instance of OpticStudio.


Lastly, the 'C:/Program Files/Zemax OpticStudio' folder is where items like the executable for the software, the Help File system, libraries needed to run OpticStudio, etc. are stored. Again, when you run OpticStudio, it won't look to this folder for any files like DLLs or macros by default, as that is specifed by your Project Preferences. This folder setup is the reason why you will need Admin privleges to install OpticStudio but won't need it to subsequently run the software and modify sample files, macros, etc (with the default settings in your Project Preferences).


Please let us know if there's any other clarifications we can make here -- we'll be happy to help more as needed!


~ Angel

Userlevel 5
Badge +3

If anyone's interested in the history of this, it all goes back to Vista 🤢


Windows versions prior to Vista had most of their security settings turned off by default (and if you were using 98 and earlier, there were really no security settings at all). That's why initially Zemax just installed into C:\Zemax and we later changed this to c:\program files\Zemax. Program files and program data were all written into this single folder.


When Vista came out it turned security on by default and added User Access Control. The problem that gave us was that since you (rightly) needed to be an Administrator to install Zemax you consequently had to be an Administrator to use the data files it (the installer) wrote.


So, we adopted the Microsoft-approved method whereby the installer wrote all the program files to C:/Program Files as usual. Administrator access is correctly required to modify these files. The data used was written to c:\program data\Zemax, and \ProgramData is provided by Microsoft specifically for this purpose. It's hidden by default and it is not intended for users for interact directly with this datastore.


Then, when the user (with standard user privileges, not Admin) runs the program, the program copies this data to the user's /documents folder on first use. This ensures that only that user's privileges are needed to use any of the data files. It also ensures that if two separate accounts on the same machine use the program, each account has its own data store that is not affected by any other user account, unless (of course) you wish to make it so.


So that's a very long-winded way of saying: we do it that way so you only need standard user privileges to run OpticStudio, even though you need Admin privileges to install it.

I just had a call with support on this matter, and thought it might be nice to leave it in this thread as feedback. I really like that you do not need to be admin to run the software. However, I ran into trouble after installing two versions of OpticStudio. First, I had 20.3 installed, but also wanted version 18.4 to redo an experiment. After installing 18.4, I noticed that the ProgramData folder now contained the 2018 version of the files (including the 2018 NetHelper). Somehow, this results in the NetHelper defaulting to the 18.4 version of Zemax. When I wanted to revert this, I found out that the 20.3 associated files are no longer in the ProgramData folder, so there is no way of obtaining them again (without a new install I guess).


It would be nice if the installer let's you choose the ProgramData folder, and not only the install folder (I might have missed this, but I think I did not have the option). 


 


Best,


 


Luc

Userlevel 5
Badge +2

Hi Luc


Thank you for the feedback. Yes the ProgramData folder contains the installation files and is overwritten.


I would share this with our product.


Sandrine

Reply