cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
chenggj
Level 3

Be confused about the type of LAAW_STARTUPINFO.lpDesktop peremeter

I want to launch an .exe file with normal user account, but my installation is run as administrator, so I want to call LaunchApplication function with LAAW_STARTUPINFO.lpDesktop = "winsta0\\default"; The sample code like following:

szProgram = INSTALLDIR ^ "GlobalPresenter.exe";

LAAW_STARTUPINFO.cb = 68;
LAAW_STARTUPINFO.wShowWindow =0;
LAAW_STARTUPINFO.dwFlags = STARTF_USESHOWWINDOW;
LAAW_STARTUPINFO.lpDesktop = "winsta0\\default";

lWait = LAAW_OPTION_WAIT;

if( LaunchApplication(szProgram, "", "", SW_SHOW, 10, lWait) < ISERR_SUCCESS) then
if(GetExtendedErrInfo ( svScriptFile, nvLineNumber, nvError ) >= ISERR_SUCCESS) then
SprintfMsiLog("Launch GlobalPresenter.exe failed because of " + FormatMessage (nvError));
endif;
else
MessageBox("startup success", INFORMATION);
endif;

 

And in the help document, it says that :

lpDesktop

Pointer to a null-terminated string that specifies either the name of the desktop only or the name of both the desktop and window station for this process. A backslash in the string pointed to by lpDesktop indicates that the string includes both desktop and window station names. If lpDesktop is NULL, the new process inherits the desktop and window station of its parent process. If lpDesktop is an empty string, the process does not inherit the desktop and window station of its parent process; instead, the system determines if a new desktop and window station need to be created. If the impersonated user already has a desktop, the system will use the existing desktop.

 

But in my setup.rul, the compiler says that: Script Files\Setup.rul(613) : error C8038: numeric value required

 

So I don't know how to use this parameter.

Labels (1)
0 Kudos
(1) Reply
banna_k
Revenera
Revenera

Hi @chenggj ,

 

It will only accept pointers, so can you try giving like below:

szDesktopId = "winsta0\\default";    // Required to declare szDesktopId as string

szProgram = INSTALLDIR ^ "GlobalPresenter.exe";

LAAW_STARTUPINFO.cb = 68;
LAAW_STARTUPINFO.wShowWindow =0;
LAAW_STARTUPINFO.dwFlags = STARTF_USESHOWWINDOW;
LAAW_STARTUPINFO.lpDesktop = &szDesktopId;

0 Kudos