On Jan 11, 2018, at 11:13 AM, Jim Hays wrote:

> Similar to Chuck, we install both our server and client apps in C:\Relevant\
> IT folks may prefer to use a different drive on a server, which is fine for
> us.
> Relevant is our company name.


I have some clients with IT departments that require apps to be installed in 
“Program Files” or “Program Files (x86)” on drive C:\. Does not matter that I 
tell them this will cause issues with updates due to Windows security settings 
and modifying things in this folder. Their response is “that’s your problem, 
you fix it." So here is what I have done.

I create a special folder structure in “Program Files” that I install my built 
4D Remote or 4D Volume Desktop apps into. I created an NSIS installer that 
requires administrative privileges to run that will set the folder in “Program 
Files” to have “Full control” security settings for “Users” group. This allows 
the 4D Remote updates to work without requiring users — or administrators — to 
have admin rights or enter passwords when a new version is installed.  

You can do this work manually by doing the following. Replace “Database” with 
the name of your 4D application.

1. Create a folder "C:\Program Files (x86)\Database\”
2. Get Properties for this folder and go to the “Security” tab
3. “Edit” groups and user names
4. Click on “Users” group
5. Click on “Full control” permissions
6. Click “Apply” and close all the windows.

That sets up an environment that will let 4D Remote and it’s update system 
work. The final and maybe most important step is to have your 4D application 
live inside another folder in "C:\Program Files (x86)\Database\”. I use a 
folder named "C:\Program Files (x86)\Database\Database Client\” and that 
contains the “Database.exe” and all the other dlls, files and folders that come 
with 4D Remote or 4D Volume Desktop. 

By having this setup it allows the 4D Remote update script to create a new 
version folder inside "C:\Program Files (x86)\Database\” folder. (Remember you 
gave it “Full control” so any program the user has started can do whatever it 
wants in that folder.) The new version of 4D Remote is downloaded and 
decompressed in the "C:\Program Files (x86)\Database\” folder. The install 
script will then delete "C:\Program Files (x86)\Database\Database Client\”  
folder and rename the new version folder to "C:\Program Files 
(x86)\Database\Database Client\” and finally launch the new version of 4D 
Remote. 

I use this same approach for built 4D Volume Desktop applications so they can 
be installed in "C:\Program Files (x86)\Database\” and my own version update 
scripts use the same scheme that 4D’s uses.

The secret in the NSIS installer script is this line that I found after much 
googling and searching the web:

  ; Set permissions for "Users" to "Full control"
  AccessControl::GrantOnFile "$INSTDIR" "(S-1-5-32-545)" "FullAccess"

The NSIS installer also does all the “fancy” stuff that Windows installers need 
to do so that the 4D application will show up in “Apps” Control Panel and gives 
the “Uninstall” option that many IT departments required.

Tim

*****************************************
Tim Nevels
Innovative Solutions
785-749-3444
[email protected]
*****************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to