ms access 2007 - Inno-Setup update HKCU of original user in Win7/Vista -


i'm trying add application path trusted location ms access install using inno setup. have following lines in script:

[registry] ; add application folder trusted location access 2007 root: hkcu; subkey: software\microsoft\office\12.0\access\security\trusted locations\{#dirname}; valuetype: string; valuename: path; valuedata: {app}; check: accessversion('2007'); root: hkcu; subkey: software\microsoft\office\12.0\access\security\trusted locations\{#dirname}; valuetype: string; valuename: description; valuedata: grandjean , braverman applications; check: accessversion('2007'); root: hkcu; subkey: software\microsoft\office\12.0\access\security\trusted locations\{#dirname}; valuetype: dword; valuename: allowsubfolders; valuedata: 1; check: accessversion('2007'); 

this works fine in windows xp , earlier, fails under user account control in vista/win7 because (elevated) user running install may different logged in user.

the workaround can think of have .reg file gets extracted , run via shellexecasoriginaluser, seems hackish. there better way?

ideally, trusted location added users on system.

i used command-line utility reg.exe updates original user's hkcu. reg.exe has shipped windows since @ least win xp. since earlier versions of windows may not have reg.exe (or may not accessible other reason), i've left registry section lines in place provide redundancy , fallback.

it's still bit hackish, think better of other alternatives. here's how lines question approach:

[registry] ; add application folder trusted location access 2007 installing user (degrades gracefully windows 2000 , earlier) root: hkcu; subkey: software\microsoft\office\12.0\access\security\trusted locations\{#dirname}; valuetype: string; valuename: path; valuedata: {app}; check: accessversion('2007'); root: hkcu; subkey: software\microsoft\office\12.0\access\security\trusted locations\{#dirname}; valuetype: string; valuename: description; valuedata: grandjean , braverman applications; check: accessversion('2007'); root: hkcu; subkey: software\microsoft\office\12.0\access\security\trusted locations\{#dirname}; valuetype: dword; valuename: allowsubfolders; valuedata: 1; check: accessversion('2007');  [run] ; add application folder trusted location access 2007 current user filename: reg.exe; parameters: "add ""hkcu\software\microsoft\office\12.0\access\security\trusted locations\{#dirname}"" /v path /t reg_sz /d ""{app}"" /f"; flags: runasoriginaluser; check: accessversion('2007'); statusmsg: adding trusted location... filename: reg.exe; parameters: "add ""hkcu\software\microsoft\office\12.0\access\security\trusted locations\{#dirname}"" /v description /t reg_sz /d ""grandjean , braverman applications"" /f"; flags: runasoriginaluser; check: accessversion('2007'); statusmsg: adding trusted location... filename: reg.exe; parameters: "add ""hkcu\software\microsoft\office\12.0\access\security\trusted locations\{#dirname}"" /v allowsubfolders /t reg_dword /d 1 /f"; flags: runasoriginaluser; check: accessversion('2007'); statusmsg: adding trusted location... 

notice lines have been copied , modified [registry] section [run] section , have flag runasoriginaluser set.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -