ShellExecute returns SE_ERR_ACCESSDENIED

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My CD-based installation program setup.exe calls ShellExecute, passing to it
a path to a valid file. This works fine on Windows 95 through XP, and on
some Vista builds. However on RC1 this fails and returns "5" -
SE_ERR_ACCESSDENIED.
Disabling UAC does not help.

The error happens only when this is invoked from a CD ROM.

If I run the same thing from a network folder instead of a CD, behavior is
different. A dialog appears with title "Open File - Security Warning", "The
publisher could not be verified. Are you sure you want to run this
software?" Options are "Run" and "Cancel", and clicking "Run" makes it
proceed as expected.
 
I have found an incompaitiblity in Vista's handling of ShellExecute.

My original (shipping) code called
HINSTANCE hInstance=::ShellExecute
(
::GetDesktopWindow(),
"open",
pszFile, // e.g. "d:\myfolder\setup.exe"
"",
NULL, // lpDirectory parameter is NULL
SW_SHOW
);
Note that the 5th parameter "lpDirectory" is NULL, and the paramter pszFile
contains a complete path. This is a valid call in all versions of Windows,
but does not seem to work on Vista RC1 when used to invoke an installation
from the root of a CD.

I can make it work if I modify the paramters as follows:
pszFile=file name and extension, e.g. "setup.exe"
lpDirectory=the drive and folder where the file resides, e.g. "d:\myfolder"

Microsoft - please please please fix this problem - it breaks my shipping CD
ROM!
 
Back
Top