ACarpenter@msn.com
Posts: 15
Joined: Sat Aug 11, 2007 12:59 am

Opening File from Custom Action Exe

I have a Custom Action set which launches an executable which has been installed to the users local hard drive. This executable needs to open an xml file which is located in the same NETWORK directory as the msi file.

The problem is that the executable launches successfully, but an Access Denied error occurs when it tries to open the network file.

However, if the executable is launched directly, it works fine.

This leads me to believe that when the MSI shells out to the executable, somehow the Read/Write access is being limited on the exe.

I've tried setting permissions, etc. on the file but nothing seems to work.

Is there a way around this?

The actual process the exe file does is as follows:

Opens a local xml file (succesfully)
Reads an entry from the xml which points to the launched MSI directory on the network (successfully)
Checks for the existance of an xml file using the above entry with a FileInfo object (fails)
If I skip the file exists check, then it attempts to open the xml file based on the path (fails)

Yet if I just launch the exe directly from the directory AFTER the install has been completed, it works fine.

???

Thanks.

Carp
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Opening File from Custom Action Exe

Hi,

I'm not sure why you are encountering this behavior. Can you please send us the AIP which shows this problem to support at advancedinstaller dot com so we can investigate it?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ACarpenter@msn.com
Posts: 15
Joined: Sat Aug 11, 2007 12:59 am

Re: Opening File from Custom Action Exe

I have sent a project but also discovered a quicker way to duplicate the issue -

Just create an exe (and custom action to launch it) that launches an OpenFileDialog and try to browse to a UNC path - an access denied error will occur, even if you have rights to the directory.

Carp
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Opening File from Custom Action Exe

Hi,

I noticed that your custom action is running as "Deferred with no impersonation". This means that the EXE will run under the local system account. Since the local system account uses null credentials for connecting to a network location, the EXE will not have enough privileges to access the files on the network.

Basically, you need to make sure that the EXE has access to the files on the network. Please try using the "Deferred" option and see what happens. Also, please make sure that the user account under which the custom action runs has read (and write) privileges for the files on the network.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”