Security issue at runtime (6.3.1) - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Alpicus
Posts: 108
Joined: Sat Feb 16, 2008 5:29 pm
Location: Switzerland
Contact: Website

Security issue at runtime (6.3.1)

Hi,

When installing an application from a WinXP workstation in a folder located on another machine (Server with Win2003) (setup made with AI 6.3.1), I receive the following error :
Using mapping X to local disk C : "Could not set file security for file 'X:\Temp\myApp\'. Error 3. Verify that you have sufficient privileges to modify the security permissions for this file."
Using UNC : "Could not set file security for file '\\MyServer\C\Temp\myApp\'. Error 5. Verify that you have sufficient privileges to modify the security permissions for this file."

The difference is Error 3 or 5 depending on the type of path.

After searching on Internet, I checked the following security items :
- Full Control on the workstation / member of Domain Admins
- Full Control on the server / member of Domain Admins
- Full Control on the share / member of Domain Admins (when using the mapping X)

Any suggestions ?

Thanks in advance.

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

Re: Security issue at runtime (6.3.1)

Hi,

Does the file exist in the specified location when the package tries to set the permissions? (you can check this right after the message is shown)
Can you please send us the AIP you are using and a log of the installation to support at advancedinstaller dot com so we can investigate them?

Note that you can generate a log for a MSI package by using this command line:

Code: Select all

msiexec /i "C:\package.msi" /L*V "C:\package.log"
where you replace C:\package.msi with the path to your installation package.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Alpicus
Posts: 108
Joined: Sat Feb 16, 2008 5:29 pm
Location: Switzerland
Contact: Website

Re: Security issue at runtime (6.3.1)

Hi,

The file doesn't exsit in the specified location but the setup could create the folder (The path was not existing before the installation).

AIP Sent to support.

Regards,

Phil
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Re: Security issue at runtime (6.3.1)

Hi Phil,

It seems that Windows Installer fails to set permissions for files/folders located on a network drive, regardless how the ACL for the network share is configured (I have tried setting Full Control share and NTFS permissions for Everyone, SYSTEM and Administrators but to no avail).

The only workaround I can suggest is to set the permissions via Custom Actions. Use either the free FileAcl tool or Xcacls for this purpose.

Hope this helps.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
Alpicus
Posts: 108
Joined: Sat Feb 16, 2008 5:29 pm
Location: Switzerland
Contact: Website

Re: Security issue at runtime (6.3.1)

Hi Ionut,

Thanks for your reply. Something is not very clear to me : am I the first person to try to install the contents of a setup on a network map :shock: ?

Phil
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Re: Security issue at runtime (6.3.1)

Hi Phil,
am I the first person to try to install the contents of a setup on a network map :shock: ?
Obviously not. The issue seems to be setting permissions on files/folders located on a network share (via the installer), not installing on a network share. I will let you know if I find any resolution for this problem.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
Alpicus
Posts: 108
Joined: Sat Feb 16, 2008 5:29 pm
Location: Switzerland
Contact: Website

Re: Security issue at runtime (6.3.1)

Hi Denis !

Thanks for your support and answer.

Regards,

Phil
Alpicus
Posts: 108
Joined: Sat Feb 16, 2008 5:29 pm
Location: Switzerland
Contact: Website

Re: Security issue at runtime (6.3.1)

Ionut wrote:Hi Phil,

It seems that Windows Installer fails to set permissions for files/folders located on a network drive, regardless how the ACL for the network share is configured (I have tried setting Full Control share and NTFS permissions for Everyone, SYSTEM and Administrators but to no avail).

The only workaround I can suggest is to set the permissions via Custom Actions. Use either the free FileAcl tool or Xcacls for this purpose.

Hope this helps.

Regards,
Ionut
I think that using the tools mentioned above will not resolve the problem as the files are created in the folder by the setup. So you cannot set the permissions before as the files are not created and you cannot set them after as the error display when creating the files.

By the way, I tried to create the folders on the network before installing and I just pointed them during the setup and it's still not working so it really seems that the creation of the files is the problem.

Hope this will help in your research and you can find a solution asap (It's my first setup to deploy in customers' production sites and I can't due to this issue so it's quite urgent : thanks in advance)

Regards,

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

Re: Security issue at runtime (6.3.1)

Hi Phil,
So you cannot set the permissions before as the files are not created and you cannot set them after as the error display when creating the files.
Please note that you need to remove the permission you configured in Advanced Installer (they are the ones which cause the error). After these permissions are removed, the package should install correctly on the network drive (our tests were successful).

Since the folders will be installed without any permissions, you need to use a custom action to set the permissions you want. This custom action can be scheduled under the "InstallExecuteSequence" -> "InstallFinalize" standard action in order to be executed after the installation is finished. Note that you can see a standard action in the Custom Actions page by using the "Show Standard Action" button on the toolbar.
I tried to create the folders on the network before installing and I just pointed them during the setup and it's still not working so it really seems that the creation of the files is the problem.
The problem is not creating the folders (this is done successfully), it is setting the permissions for them. Therefore, it doesn't matter if the folders are already created when the installation runs because the installation will fails when the permissions are set. Since the files are installed after the permissions are set for the folders, the files will not be created if the installation fails.
It's my first setup to deploy in customers' production sites and I can't due to this issue so it's quite urgent
The solution is the one suggested by Ionut: use FileAcl or Xcacls as a custom action. Here are the steps for using Xcacls:
- add the XCACLS.vbs file to your installation package
- go to the "Custom Actions" page and create a "New Attached Custom Action" under "InstallExecuteSequence" -> "InstallFinalize"
- in the "Select a file to execute as a custom action" dialog go to the Advanced Installer installation folder and select the "aicustact.dll" file from the "custact" folder
- in the "Custom Action Properties" page set the "Function Name" combo to "CreateExeProcess"
- set the "Action Data" field to:

Code: Select all

"[SystemFolder]cscript.exe" "[#XCACLS.vbs]" "C:\MyFolder" /G MyUser:F
- this is an example, you can adapt the command line to what you need
- set the "Execution Options" section to "Deferred with no impersonation"
- make sure that the "Expression" field is set to "NOT Installed"

This custom action will launch "Cscript.exe" from the "system32" folder in order to run the "XCACLS.vbs" script with the specified parameters. In this example I used our "CreateExeProcess" function to make sure that "Cscript.exe" does not show any command windows.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Alpicus
Posts: 108
Joined: Sat Feb 16, 2008 5:29 pm
Location: Switzerland
Contact: Website

Re: Security issue at runtime (6.3.1)

Thanks Cosmin !

You're right : I also discovered that the problem is the setting of permissions and not folders/files creation.

I will take a look at your solution and try.

Regards,

Phil
arturosmx
Posts: 4
Joined: Wed Jul 22, 2009 3:59 am

Re: Security issue at runtime (6.3.1)

Hi,
The solution is the one suggested by Ionut: use FileAcl or Xcacls as a custom action. Here are the steps for using Xcacls:
- add the XCACLS.vbs file to your installation package
- go to the "Custom Actions" page and create a "New Attached Custom Action" under "InstallExecuteSequence" -> "InstallFinalize"

...

- set the "Execution Options" section to "Deferred with no impersonation"
- make sure that the "Expression" field is set to "NOT Installed"

This custom action will launch "Cscript.exe" from the "system32" folder in order to run the "XCACLS.vbs" script with the specified parameters. In this example I used our "CreateExeProcess" function to make sure that "Cscript.exe" does not show any command windows.

Regards,
Cosmin
I'm evaluating version 7.1.1 and if you create an attached custom action under "InstallExecuteSequence" -> "InstallFinalize", you can't select the option: "Deferred with no impersonation". I plan to deploy my application to Vista machines and I don´t know if this can cause some problems.

Is it a change you made or I'm missing something?

Kind regards.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Security issue at runtime (6.3.1)

Hi,

Please note that a "Deferred" custom action can be scheduled only between the InstallInitialize and InstallFinalize sequences.

You can read more about this here:
http://www.advancedinstaller.com/user-g ... rties.html
http://msdn2.microsoft.com/en-us/library/aa368268.aspx

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bblair
Posts: 2
Joined: Wed Jul 29, 2009 10:09 pm

Re: Security issue at runtime (6.3.1)

Cosmin:

I have followed all of the step listed below, but my installation quits and rolls back the files. Maybe I am not modifying the command line correctly. Can you please explain what

"[SystemFolder]cscript.exe" "[#XCACLS.vbs]" "C:\MyFolder" /G MyUser:F

means and what I need to modify? I changed "C:\MyFolder" to the location of xcacls.vbs.

Do I need to change /G MyUser:F? What does this mean?

Thanks.

The solution is the one suggested by Ionut: use FileAcl or Xcacls as a custom action. Here are the steps for using Xcacls:
- add the XCACLS.vbs file to your installation package
- go to the "Custom Actions" page and create a "New Attached Custom Action" under "InstallExecuteSequence" -> "InstallFinalize"
- in the "Select a file to execute as a custom action" dialog go to the Advanced Installer installation folder and select the "aicustact.dll" file from the "custact" folder
- in the "Custom Action Properties" page set the "Function Name" combo to "CreateExeProcess"
- set the "Action Data" field to:

Code: Select all
"[SystemFolder]cscript.exe" "[#XCACLS.vbs]" "C:\MyFolder" /G MyUser:F- this is an example, you can adapt the command line to what you need
- set the "Execution Options" section to "Deferred with no impersonation"
- make sure that the "Expression" field is set to "NOT Installed"
Last edited by bblair on Thu Jul 30, 2009 7:16 pm, edited 1 time in total.
bblair
Posts: 2
Joined: Wed Jul 29, 2009 10:09 pm

Re: Security issue at runtime (6.3.1)

So where does this script need to be run if not under installfinalize? Needs to be between Initialize and Finalize but not sure where.

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

Re: Security issue at runtime (6.3.1)

Hi,
Can you please explain what
"[SystemFolder]cscript.exe" "[#XCACLS.vbs]" "C:\MyFolder" /G MyUser:F
means and what I need to modify?
This is a command line which can run in Windows. The "[SystemFolder]" installer property will be resolved to the system32 folder when the installation runs, so the resolved value would look like this:

Code: Select all

C:\Windows\system32\cscript.exe
"[#XCACLS.vbs]" is a formatted value which represents a reference to the XCACLS.vbs file added in your project. When the installation runs the reference is resolved to the full path of the file, for example:

Code: Select all

C:\Program Files\Your Company\Your Application\XCACLS.vbs
"C:\MyFolder" represents the folder on which you want to set permissions. "MyUser" represents the user account for which you set permissions. "/G" and ":F" are command line parameters for XCACLS.vbs, you can read more about them here.

When the installation runs, the resolved command line would look like this:

Code: Select all

"C:\Windows\system32\cscript.exe" "C:\Program Files\Your Company\Your Application\XCACLS.vbs" "C:\MyFolder" /G MyUser:F
and it will basically grant full privileges to "MyUser" for the "C:\MyFolder" directory. Please read all the articles from the links I mentioned to better understand how this works.
So where does this script need to be run if not under installfinalize? Needs to be between Initialize and Finalize but not sure where.
You can add it under "InstallExecuteSequence" -> "Install".

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

Return to “Common Problems”