Installion/Registration for current user or all users...

Add-in Express™ Support Service
That's what is more important than anything else

Installion/Registration for current user or all users...
 
Heinz-Josef Bomanns




Posts: 201
Joined: 2008-02-28
Hi,

we use Setup Factory for our setups. During setup the user can choose to install the add-in for the current user or for all users. Depending on his selection we call adxregistrator.exe with 'privileges=user' for a current user installation via HKCU or with 'privileges=admin' for an all users installation via HKLM. This doesn't work because we have 'RegisterForAllUsers' set to 'False' to avoid an all users installation even if the user selects a current user installation. If i set 'privileges="administrator"' in adxloader.dll.manifest, it works, but this file is updated on compile and resetted to 'privileges="user"', so the next time i compile my setup it again doesn't work. Or with other words: Even if adxregistrator.exe is called with 'privileges=admin' it doesn't register for all users if adxloader.dll.manifest has 'privileges="user"'. Is there a way to avoid manually changes to adxloader.dll.manifest every time i have to compile my setup? Thanks for any hints...

BTW: Would be nice to simply have two switches more for adxregistrator.exe: for e.g. /current to register via HKCU or /all to register via HKLM...
__________________
Greetings, HJB
Posted 27 Mar, 2012 03:46:56 Top
Andrei Smolin


Add-in Express team


Posts: 14356
Joined: 2006-05-11
Hi HJB,

Thank you for the suggestion.

Consider using a copy of adxloader.dll.manifest or editing it in a pre-build or post-build event.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 27 Mar, 2012 04:48:35 Top
Heinz-Josef Bomanns




Posts: 201
Joined: 2008-02-28
Hi Andrei,

we have 250+ add-ins and exactly as many setups, changing them for dealing with individual manifest files would be a work of days or weeks. I got around this with a routine in a global function included/called by all setups that changes the manifest file as needed:

-- Register Add-In-DLL via ADXRegistrator.exe
----------------------------------------------------------------------------------------------------
if (AllUsersInstall == 1) then -- All users
	-- Modify manifest file
	local sManifestFile=SessionVar.Expand("%AppFolder%\adxloader.dll.manifest");
	local sTmp= "";
	sTmp= TextFile.ReadToString(sManifestFile);
	sTmp = String.Replace(sTmp, "privileges="user"", "privileges="administrator"", false);
	-- Dialog.Message("Test", sTmp);
	TextFile.WriteFromString(sManifestFile, sTmp, false);
	-- Call adxregistrator.exe
	File.Run(SessionVar.Expand("%AppFolder%\adxregistrator.exe"), SessionVar.Expand("/install=%AddInDLL% /privileges=admin"), SessionVar.Expand("%AppFolder%"), SW_MINIMIZE, true);
else -- Currrent user only
	File.Run(SessionVar.Expand("%AppFolder%\adxregistrator.exe"), SessionVar.Expand("/install=%AddInDLL% /privileges=user"), SessionVar.Expand("%AppFolder%"), SW_MINIMIZE, true);
end

Maybe it's of use for other Setup factory users...
__________________
Greetings, HJB
Posted 29 Mar, 2012 01:31:54 Top
Andrei Smolin


Add-in Express team


Posts: 14356
Joined: 2006-05-11
Heinz-Josef Bomanns writes:
we have 250+ add-ins


I nearly fell off my chair!

Congratulions, many thanks and regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Mar, 2012 01:53:36 Top