Unable to create folder in C:\Windows\WinSXS in Vista OS

Hi,

I was checking compatibility of one of my MFC application in Vista OS. Usually if the MFC shared dlls are not present, i used to copy them in WinSXS under folder with the required folder name like x86_Microsoft.VC80.xxxx. (Installing VC++ Redist also didnt work in my case.) And this would make the application work perfectly.

When i tried to do the same thing in Vista OS, it failed to create the folder. I removed the read only attributes and tried again but in vain. The error i am getting is "User didnt have enough permission to perform this task" but I logged in as Administrator.

I tried to change the security attibutes of Administrator but could not find the Users under Computer Management.

Is there any solution / work around for this issue?

Rosh K. Mathews

[820 byte] By [RoshKMathews] at [2008-2-22]
# 1

Rosh,

Are you using the Microsoft supplied merge modules in your installer? You shouldn't be copying the DLLs directly, or setting them up explicitly - you should be using the supplied Merge Modules. This is what our application does and it seems to install fine on Vista as an administrative user.


Here's some background information on Merge Modules for MFC that might help if you are not familiar on the subject:

The merge modules can typically be found in
C:\Program Files\Common Files\Merge Modules
on systems with Visual Studio 2005 installed.

Using any MSI based installer solution (which you really should be if you want it to work on Vista, or get certified), you can "blend" the merge module into your installer.

For each MFC or CRT merge module there is also a required policy merge module, e.g.:
Microsoft_VC80_MFC_x86.msm
policy mege module is:
policy_8_0_Microsoft_VC80_MFC_x86.msm

Some of the merge modules are also interdependant. For instance, make sure that you install the MFCLOC module if you install the MFC module.

This URL to the MSDN library contains an overview of installing using a setup or deployment project type in Visual Studio. It discusses the merge modules you need and how to use them: http://msdn2.microsoft.com/en-us/library/ms235317.aspx


I hope that helps somewhat...

Robert

RobertTurner at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 2

Hi Turner,

I am using Merge Module in my installation, but it does not copy the files to WinSxs folder. Says that user dont have enough privilege. This happens even if the installation is executed as an Administrator.

How are u copying the files? Can u tell me the source and destn, so that i can get a hint on how to go abt it?

My installation does work fine in WinXP but not in Vista.

Thanks,

RKM.

RoshKMathews at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 3

Rosh,

You're running into a new feature called Windows Resource Protection. It is the successor of Windows File Protection on XP. If you look at the security properties of the mfc file, you'll notice that only the Trusted Installer has full rights; even System and Administrator have read-only permissions.

Robert is correct that you should be using merge modules so that you can have the Windows Installer service install the "system" files.

# 4

Hi again Maarten, thanks for ur advice,

So u mean to say that i shud have created an msi file instead of the good old 'setup.exe' ? so that windows installer will execute from its end? and should i again run it as 'Run as Administrator' from the More options/ right click Menu?

Rosh K. Mathews.

RoshKMathews at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 5

Rosh,

I need to correct myself. In Vista most (if not all) redistributables (such as MFC, VCRT, etc.) are already installed. They are protected by WRP and even Local System or administrators can't update them. They are owned by the trusted installer. Windows Installer will ignore the access denied it gets when a Merge Module tries to install files into the winsxs directory. You can keep the merge modules in your setup for downlevel platforms since they don't do any harm.

Are you sure that you need to install those files?

Maarten

# 6

hi maarten, True. Most of them are installed but not all. If all were installed, then i wouldnt have got into this in the first place .

If you could have 50608 version in the Winsxs, then it would be gr8 because all exes which i develop are checking for this version. In Vista there is no 'Policies' folder, where there is a mapping for 50608 version to 50727 version.

Thanks a lot for replying.

Rosh K. Mathews.

RoshKMathews at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 7

How hard would it be to change the apps dependency on 50608 since it doesn’t look like the 50608 is included?

Thanks,
Louis Shanks

AppCompat

LouSha at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 8

I am not sure how to give specific dependency to 50727 MFC dlls because by default it is giving dependency on v50608 MFC dll. Can u help me regarding the same?

Rosh.

RoshKMathews at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 9

Could you send us a little repro Rosh?

Maarten

# 10

Sorry, but i didnt understand whaz a 'repro'? Can u throw some light on that :)

Rosh K. Mathews

RoshKMathews at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 11

What I meant was a little code sample that would show the behavior you're seeing. But I went ahead and built a small MFC app and saw that the manifest is asking for that same

version="8.0.50608.0"

that you have. If I deploy the release version of that application on a clean Vista RC2 machine it works as expected.

Are you running the debug version? Some interesting reading is here:

http://blogs.msdn.com/junfeng/archive/2006/04/14/576314.aspx

# 12

After more digging, I have to correct myself a second time (two 180s make a 360 and we're back on track). Sincere apologies for the delay and the confusion.

The way to do it is through merge modules. This explains how.

Aparently the Windows Installer service delegates installing those merge modules to the Windows Module Installer service. This last service is running under the Trusted Installer account, which is the only account with full rights on the winsxs directory. (And other directories under %windir% and registry hives).

Will blog about this shortly.

http://blogs.msdn.com/vistacompatteam/

Maarten

# 13

Hi Maarten,

That was good. Something which i was exactly looking for. I have never tried with VC++ Express though. I will check the same and will update.

So far that looks good enough. Thanks for considering me seriously and taking pain to find it. I owe you one.

Thanks again.

Rosh K. Mathews.

RoshKMathews at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 14

Hi,

Thank you for the valuable information to all the participants in this thread.

I have been looking for this information as well.

But I still have a problem with my scenario.

I need my installation setup to replace the current version of the codec ir50_32.dll in C:\Windows\System32 folder with a later version.

I have created a merge module that contains a later version of the dll and included it in the setup (as recommended) and then run the set up while logged on as administrator. But the current version was not replaced.

I then tried to run the setup 'Run as administrator' and this also did not work.

I would appreciate any help on this.

Many thanks,

N.

bukashka at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...

Software Development for Windows Vista

Site Classified