I am quite a newbie here, so please forgive me if the question got
covered already - please point me to the relevant post/page, I failed
to google anything useful so far.
I've made quite a sophisticated ExcelDNA-based add-in, and now I need
to install it for all users so they don't need to open XLL when
launching Excel. Single-user installation via Open registry key works
beautifully, is there a way to make it work for all users somehow?
Thanks,
Michael
1. You could try to add respective OPENx key for all users via
registry hives. This could be done as follows:
1.1. Get list of all users using ManagementObjectSearcher;
1.2. Get personal folder for each user;
1.3. Load NTUSER.DAT using the RegLoadKey() function (WinApi)
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724889(v=vs.85).aspx
. This file is located in the personal folder.
1.4. Use the WinApi functions to add/remove OPENx
1.5. Unload NTUSER.DAT with RegUnLoadKey()
Accessing registry of other users:
http://stackoverflow.com/questions/6564153/edit-registry-key-of-other-user
This could be done inside the installer.
2. You could try to add the OPENx key via the UserSettings registry
path of Office
About UserSettings:
http://blogs.technet.com/b/deploymentguys/archive/2011/05/31/deploying-custom-registry-settings-for-office-2010.aspx
3. You could try to create small COM addin in C# (without Excel-Dna)
and register it in HKLM. The only thing this COM addin does is
registeration of your Excel-Dna addin when Excel starts up (using the
Application.RegisterXll(string) function). The Excel-Dna addin will be
unregistered automatically when Excel exits.
RegisterXll function: http://msdn.microsoft.com/en-us/library/bb223580(v=office.12).aspx
How to create Com addin: http://support.microsoft.com/kb/302901
Best regards,
Sergey
I can add to Sergey's excellent list some more options:
* Put a registration script (batch file or VBS or something) in a
startup folder, according to the answer here:
http://stackoverflow.com/questions/5092477/set-that-a-program-has-to-run-at-startup-from-an-installer.
* Use 'Active Setup' (which allows you to run stuff every time a new
user logs in. It's not clear whether it is still supported, but this
would be a start: http://www.etlengineering.com/installer/activesetup.txt.
This is the only way I know to ensure that new users using the machine
will also have the add-in installed, and that will work with all
Office versions (though maybe not all Windows versions).
-Govert
On Dec 6, 7:09 pm, Sergey Zhilyakov <nayk....@gmail.com> wrote:
> Hi Michael,
>
> 1. You could try to add respective OPENx key for all users via
> registry hives. This could be done as follows:
> 1.1. Get list of all users using ManagementObjectSearcher;
> 1.2. Get personal folder for each user;
> 1.3. Load NTUSER.DAT using the RegLoadKey() function (WinApi)http://msdn.microsoft.com/en-us/library/windows/desktop/ms724889(v=vs...
> . This file is located in the personal folder.
> 1.4. Use the WinApi functions to add/remove OPENx
> 1.5. Unload NTUSER.DAT with RegUnLoadKey()
>
> Accessing registry of other users:http://stackoverflow.com/questions/6564153/edit-registry-key-of-other...
>
> This could be done inside the installer.
>
> 2. You could try to add the OPENx key via the UserSettings registry
> path of Office
>
> About UserSettings:http://blogs.technet.com/b/deploymentguys/archive/2011/05/31/deployin...
I can't really find documentation on MSDN, but there are lots of
useful-looking hits on Google:
http://www.google.co.za/search?hl=en&q=active+setup&oq=active+setup&aq=f&aqi=&aql=&gs_sm=e&gs_upl=229728l229728l0l229962l1l1l0l0l0l0l0l0ll0l0
and for Windows 7 specific issues (there are some):
http://www.google.co.za/search?gcx=w&sourceid=chrome&ie=UTF-8&q=active+setup+windows+7
These discussions looked particularly useful to read:
http://stackoverflow.com/questions/2934912/pros-cons-of-using-windows-active-setup
http://social.technet.microsoft.com/Forums/en-US/w7itproinstall/thread/71304f64-e198-4c07-8282-33c7fd6924e2/
http://social.msdn.microsoft.com/Forums/en-CA/windowsgeneraldevelopmentissues/thread/2f0ed426-bba1-4b77-834c-5e3056d8403f
-Govert
On Dec 8, 10:58 am, Govert van Drimmelen <gov...@icon.co.za> wrote:
> Hi Michael,
>
> I can add to Sergey's excellent list some more options:
>
> * Put a registration script (batch file or VBS or something) in a
> startup folder, according to the answer here:http://stackoverflow.com/questions/5092477/set-that-a-program-has-to-....
thanks a ton for the pointers, I have tried the approach #2 and it
seems to work - thanks again!
Michael
On Dec 6, 9:09 pm, Sergey Zhilyakov <nayk....@gmail.com> wrote:
> Hi Michael,
>
> 1. You could try to add respective OPENx key for all users via
> registry hives. This could be done as follows:
> 1.1. Get list of all users using ManagementObjectSearcher;
> 1.2. Get personal folder for each user;
> 1.3. Load NTUSER.DAT using the RegLoadKey() function (WinApi)http://msdn.microsoft.com/en-us/library/windows/desktop/ms724889(v=vs...
> . This file is located in the personal folder.
> 1.4. Use the WinApi functions to add/remove OPENx
> 1.5. Unload NTUSER.DAT with RegUnLoadKey()
>
> Accessing registry of other users:http://stackoverflow.com/questions/6564153/edit-registry-key-of-other...
>
> This could be done inside the installer.
>
> 2. You could try to add the OPENx key via the UserSettings registry
> path of Office
>
> About UserSettings:http://blogs.technet.com/b/deploymentguys/archive/2011/05/31/deployin...
please note that this approach works only for Excel 2007 and 2010.
Sergey.