CreateProcess("C:\Program Files\Appname\Runme.exe",
NULL,
NULL,//95 ignores
NULL,//95 ignores
TRUE,
NORMAL_PRIORITY_CLASS,
NULL,
NULL,
&si,
&pi);
I created empty STARTUP_INFO and PROCESS_INFO structures, and I verified
that the runme.exe does exist at the path specified. I want to wait for this
.exe to complete execution before I go on, but I know how to do that ( i
think =] ) if I could only get it to actually launch.
Thanks a whole lot.
Jason W. Taylor
Jason W. Taylor <jta...@cerner.com> wrote in article
<#d2mIW4...@uppssnewspub05.moswest.msn.net>...
> I have some code that is supposed to launch an installshield self
extracting
> and installing .exe. I cannot get CreateProcess to launch it. And it
always
> returns 0 , as in "success". Even though nothing happens. (I'm in win95)
>
> CreateProcess("C:\Program Files\Appname\Runme.exe",
> NULL,
......
-Sai Kayal
Note that the filename and path I'm passing is actually a CString with
correct implementation of "\" characters. I didn't put that in the original
email for brevity.
Jason,
Since a backslash in a C string is used to indicate the beginning
of an escape sequence, you must use double bachslashes:
"C:\\Program Files\\Appname\\Runme.exe"
Cheers,
Patrik
------
If replying by email, remove the spam protection stuff ".---",
at the end of my return address.
Lance,
No, that won't work. It would cause error 123 (ERROR_INVALID_NAME).
It's giving me error number 37 "The parameter is incorrect". What
parameter?? Is it talking about the parameters I'm passing to
CreateProcess()? I'm confused.
Jeremy Wise wrote in message <343525...@compuserve.com>...
>Jason W. Taylor wrote:
>>
>> I have some code that is supposed to launch an installshield self
extracting
>> and installing .exe. I cannot get CreateProcess to launch it. And it
always
>> returns 0 , as in "success". Even though nothing happens. (I'm in win95)
>>
>> CreateProcess("C:\Program Files\Appname\Runme.exe",
>> NULL,
>> NULL,//95 ignores
>> NULL,//95 ignores
>> TRUE,
>> NORMAL_PRIORITY_CLASS,
>> NULL,
>> NULL,
>> &si,
>> &pi);
>>
>> I created empty STARTUP_INFO and PROCESS_INFO structures, and I verified
>> that the runme.exe does exist at the path specified. I want to wait for
this
>> .exe to complete execution before I go on, but I know how to do that ( i
>> think =] ) if I could only get it to actually launch.
>>
>> Thanks a whole lot.
>>
>> Jason W. Taylor
>
>Jason-
>
>Seems to me that if CreateProcess is returning ZERO, then the call is
failing not
>succeeding. Generally what you want to do in that case is to call
GetLastError() to
>retrieve the error code for the error. There is a pretty full description
in the online
>help for CreateProcess for how to get the root error. I recently had a
problem with
>CreateProcess failing because it could not locate a DLL that the EXE
referenced as the
>DLL and EXE were in different locations and the DLL could not be found in
the standard
>places the system looks.
>
>Good luck, Jeremy Wise
As Sai Kayal said, this should be "C:\\Program Files\\Appname\\Runme.exe"
[snip]
>I created empty STARTUP_INFO and PROCESS_INFO structures,
You set si.cb = sizeof(STARTUP_INFO), I hope.
>I want to wait for this
>.exe to complete execution before I go on, but I know how to do that ( i
>think =] ) if I could only get it to actually launch.
You're may have a problem in any case because this is an InstallShield
installation. Your self-extracting EXE created with EXE Builder will launch
SETUP.EXE, a 16-bit program, which will then launch the 32-bit install
process, _INS0432._MP. You can wait for the self-extracter to finish, but
that doesn't mean that installation is actually complete. (This is true for
InstallShield 3.x, see InstallShield KB Q10100, Q10379 -- I'm not so sure
about InstallShield 5).
Katy
--
Katy Mulvey k...@ormec.com
Software Development Engineer
ORMEC Systems http://www.ormec.com
Do you initialize the STARTUPINFO struct correctly?
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
1. The path should probably have embedded double-quotes around it.
Construct the CString thus:
CString strPath( "\"c:\\program files\\appname\\runme.exe\"");
The docs say that CreateProcess should be able to get around the white
space in "program files" but you never can tell. It's worth a try if you
haven't already.
Lance
lance_hates_@_spam_worldnow.com
WorldNow Online Inc.
Jason W. Taylor <jta...@cerner.com> wrote in article
<#d2mIW4...@uppssnewspub05.moswest.msn.net>...
> I have some code that is supposed to launch an installshield self
extracting
> and installing .exe. I cannot get CreateProcess to launch it. And it
always
> returns 0 , as in "success". Even though nothing happens. (I'm in win95)
>
> CreateProcess("C:\Program Files\Appname\Runme.exe",
> NULL,
> NULL,//95 ignores
> NULL,//95 ignores
> TRUE,
> NORMAL_PRIORITY_CLASS,
> NULL,
> NULL,
> &si,
> &pi);
>
> I created empty STARTUP_INFO and PROCESS_INFO structures, and I verified
> that the runme.exe does exist at the path specified. I want to wait for
this
> .exe to complete execution before I go on, but I know how to do that ( i
> think =] ) if I could only get it to actually launch.
>
>I have some code that is supposed to launch an installshield self extracting
>and installing .exe. I cannot get CreateProcess to launch it. And it always
>returns 0 , as in "success". Even though nothing happens. (I'm in win95)
I suspect Patrik is right, it's your STARTUPINFO initialisation.
Here's how I normally do mine :
BOOL StartApp (const char * szAppString,
int nCmdShow)
{
STARTUPINFO sui ;
PROCESS_INFORMATION pi ;
BOOL bRet;
sui.cb = sizeof (STARTUPINFO);
GetStartupInfo (&sui);
sui.dwFlags = STARTF_USESHOWWINDOW ;
sui.wShowWindow = nCmdShow ; // see parameters
bRet = CreateProcess (NULL,
szAppString, // force path search
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&sui,
&pi);
Bob Moore [WinSDK MVP]
Daniel
http://www.activeplus.com
Jeremy Wise wrote:
> Jason W. Taylor wrote:
> >
> > I have some code that is supposed to launch an installshield self extracting
> > and installing .exe. I cannot get CreateProcess to launch it. And it always
> > returns 0 , as in "success". Even though nothing happens. (I'm in win95)
> >
> > CreateProcess("C:\Program Files\Appname\Runme.exe",
> > NULL,
> > NULL,//95 ignores
> > NULL,//95 ignores
> > TRUE,
> > NORMAL_PRIORITY_CLASS,
> > NULL,
> > NULL,
> > &si,
> > &pi);
> >
> > I created empty STARTUP_INFO and PROCESS_INFO structures, and I verified
> > that the runme.exe does exist at the path specified. I want to wait for this
> > .exe to complete execution before I go on, but I know how to do that ( i
> > think =] ) if I could only get it to actually launch.
> >
> > Thanks a whole lot.
> >
> > Jason W. Taylor
>