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

Major problem with SP2 for Windows Server 2003


4 replies to this topic

shuttledude

shuttledude
  • Full Members
  • 26 posts

Posted 01 May 2007 - 19:59

I have an InstallShield Pro 5.1 program that fails on Service Pack 2 of Windows Server 2003. Service Pack 1 and the "R2" version of Windows Server 2003 are both OK.

What happens is that LaunchAppAndWait( ) is not allowed to launch certain executable files. It returns a -1 error code.

This install program works on all other operating systems, so I suppose it has to do with tighter security or something else which changed with Service Pack 2.

I even tried creating a *.bat batch file with the command in it, and then invoking the batch file, but that failed as well.

I am logged on as an Administrator.

Any ideas? The clock is running out on this one, and I'm not sure what to do. ohmy.gif

Edited by shuttledude, 05 May 2007 - 14:41.


shuttledude

shuttledude
  • Full Members
  • 26 posts

Posted 05 May 2007 - 14:40

I have since discovered that the problem is not really with InstallShield's LaunchAppAndWait function; it is with the _LaunchAppEx function which I downloaded from this website. ohmy.gif I use _LaunchAppEx because it can hide windows whereas LaunchAppAndWait cannot -- when I rewrote the code to use LaunchAppAndWait the problem disappeared.

I'm not sure why. Perhaps LaunchAppAndWait uses the old WinExec function ( _LaunchAppEx uses kernel32.CreateProcessA).

I'd still like to know exactly what in Service Pack 2 for Windows Server 2003 broke my code. I'd like to keep it the way it is if possible. If anyone has any ideas I'd appreciate it.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 05 May 2007 - 17:56

It might be some parameter that LaunchAppEx uses for CreateProcess, I don't know. If you ever find out please let me know so that I can update LaunchAppEx.

Keith_Brand

Keith_Brand
  • Full Members
  • 2 posts

Posted 07 August 2007 - 02:19

QUOTE (shuttledude @ 2007-05-05 14:40)
I'd like to keep it the way it is if possible.  If anyone has any ideas I'd appreciate it.

Please excuse the quality of my post. It is my first one ever.

I have just (in the last couple of hours) overcome this problem by commenting out the following lines in _LaunchAppEx:

kernel32.CloseHandle(piData.hProcess);
kernel32.CloseHandle(piData.hThread);


Keith_Brand

Keith_Brand
  • Full Members
  • 2 posts

Posted 21 October 2008 - 22:25

My previous post is in fact a workaround!

I have discovered the true cause of the problem.

Our software upgrade process spends most of its time running external applications in hidden windows. While working on enhancements that give the user an indication that the upgrade process is still alive and informing them of Task Manager's PID (Process ID) for the application, I discovered that the reported PID was not listed by Task Manager for the application I had launched.

I got suspicious.

After checking out the InstallShield data types, I changed HWND to NUMBER for hThread in the type definition for PROCESS_INFORMATION in LaunchAppEx.h as follows:

typedef PROCESS_INFORMATION
begin
NUMBER hProcess;
// HWND hThread; Doesn't work correctly!
NUMBER hThread;
NUMBER dwProcessId;
NUMBER dwThreadId;
end;


The reported hProcess then corresponded to the PID reported for my application under Task Manager.

I then UNcommented the following two lines in LaunchAppEx.rul

kernel32.CloseHandle(piData.hThread);
kernel32.CloseHandle(piData.hProcess);


My installation / upgrade process runs fine in our test environments including Server 2003 Service Pack 2.