Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Registering my .exe with regserver on Vista


2 replies to this topic

sudarshan123

sudarshan123
  • Full Members
  • 10 posts

Posted 28 February 2008 - 18:49

Hi,
This is aproblem with Vista with UAC on.
I have installshield 10.5.
I have a custom action which does the following.
Its of type
QUOTE
launch an executable.

As commandline parameter it accepts:
cmd /c CosmoAgent.exe(My app name, I have also tried giving the full directory name) /regserver.
The custom action is deferred with system context. In the sequence of custom action its on execute sequence between between InstallIntialize and InstallFinalize.
It is placed after PublishProduct. It is absent from admin execute sequence.

All it needs to do is register this object, so that anyone can launch this application and does not need admin rights to do so.
Now on vista with UAC on this cosmoagent.exe /regserver fails.
After installation from a elevated command prompt I need to give this command.Then it succeedsand registers everything.Only then can common users launch this exe. Otherwise after installation if any common user wants to launch the exe or if I try to launch the exe from my setup I get the following error:
Unexpected error: quiting.
Also users can luanch with admin rights.And also once user does that, he can at a later point launch the exe just as common user.I suppose launching with admin rights creates the registries.
So my question is how do I register my component using regserver.Can it be done from intsallshield 10.5, with specification that this needs elevated rights or needs to run from elevated command prompt?Marking the custom action as deferred with system context did not help. Does a later version allow this?
Also I tried to write custom actions as shellexecute and shellexecuteEX from C++ code instead to achieve this goal. ShellExecute fails.I do not know whether I am giving the correct parameters for shellexecuteEX.
I am giving the following parameters:
CODE
ExecuteInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ExecuteInfo.lpVerb = "runas";
ExecuteInfo.hwnd = NULL;
ExecuteInfo.lpFile = "C:\\Program Files\\Cosmocom\\Agent\\CosmoAgent.exe";
ExecuteInfo.lpParameters = "/regserver";
ExecuteInfo.lpDirectory = "C:\\Program Files\\Cosmocom\\Agent";
and then ShellExecuteEx(&ExecuteInfo).
This gives me different error. Sometimes it says parameter "C:\\Program Files\\Cosmocom\\Agent\\CosmoAgent.exe is wrong.Sometimes it says there is not program associated with the file to perform this action.

So if you could please give me pointers as how to tackle this problem from installshield or from C++ it shall be of great help

Edited by sudarshan123, 28 February 2008 - 20:29.


aldebarande

aldebarande
  • Full Members
  • 19 posts

Posted 29 February 2008 - 11:01


Hi,

I have InstallShield 12 and as soon as UAC is on I have similar issues.
For the moment I have no solution other than set UAC off.

If you find a solution, please let us all know.
Maybe the Vista SP1 will solve that. dry.gif

Thanks,

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 05 March 2008 - 13:08

I don't think that a later version of InstallShield or Vista SP1 will solve this problem for you.

In general, this method of self registration is not recommended. If possible, extract the COM registration information and put it in your setup (Class and/or RFegistry table etc.)

Do you get an error message or code from your cmd call? Or is missing registry entry the only indication that it failed? here's two places where such registration information can be stored, in HKLM\Classes and in HKCU\Classes. They both get merged in HKCR. If your application, when launched with /regserver, creates its registration information in HKCU this would explain the problem. You must make sure it creates its entries in HKLM.