Deploy 2007 as runtime, trusted location

spikepl

Eledittingent Beliped
Local time
Today, 18:58
Joined
Nov 3, 2010
Messages
6,134
I have been playing with Runtime 2007, and ran into the issue of setting trusted location on the foreign machines. A little googling reveals old threads her, such as http://www.access-programmers.co.uk/forums/showthread.php?t=136411 , where one manually can change registry settings.

According to http://office.microsoft.com/en-us/access-help/deploy-an-access-2007-application-HA010218864.aspx if the lot is packaged using the developer extensions, then the package can "Add the install folder as a trusted location." This, I presume, resolves the trusted location iussue with security warning/question at startup. Is that so? Can I package the lot such that the user does not get issues with trusted location?
 
I fought with this for a while and eventually figured out the solution based on the thread referenced above, and "Hey, Scripting Guy" posts. Below is a template script that is working on my network; this solves the issues of non-admins editing the registry as the scope is for the current user, not all users. I saved the script as Trusted_Locations.vbs in a scritpts folder in the sysvol. We use a batch file for login scripts and other tasks. The command in the batch file to call the script is:

\\[Server]\sysvol\[domain]\scripts\Trusted_Locations.vbs

Trusted_Locations.vbs VBScript:

Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

'Turn Macro warnings off:
strKeyPath = "Software\Microsoft\Office\12.0\Access\Settings"
strValueName3 = "VBAWarnings"
dwValue3 = 1
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName3, dwValue3

'Allow Network Locations in the Trusted Locations:
strKeyPath = "Software\Microsoft\Office\12.0\Access\Security\Trusted Locations"
strValueName4 = "AllowNetworkLocations"
dwValue4 = 1
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName4, dwValue4


'Create the trusted Location and details
strKeyPath = "Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\[ Location01]"
objRegistry.CreateKey HKEY_CURRENT_USER, strKeypath

strValueName = "Description"
szValue = "[Enter description here]"
objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, szValue

strValueName1 = "Path"
szValue1 = "\\[Server]\[Share]"
objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName1, szValue1

strValueName2 = "AllowSubFolders"
dwValue2 = 1
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName2, dwValue2
 

Users who are viewing this thread

Back
Top Bottom