Set shortcut app Compatability option through MSI script

R

RKirk

Hello,

Apologies if in wrong NG.
How can I programmatically set the application
compatability of a shortcut from a batch or command file
or form within an MSI script? Or even from code (VB).

I understand that the file "LayerStorage.dat" contains the
entries but the file is not readable. Is it possible to
decode the file so I can add entries to it??

Thanks.
 
C

Carolyn Napier [MSFT]

I'm not 100% certain I know what you're after. I think you're talking about
having some program run using one of the application compatibility modes. Is
that correct?

One thing I'd suggest is checking out the Microsoft Windows Application
Compatibility Toolkit. You can find it at:
http://www.microsoft.com/windowsserver2003/compatible/appcompat.mspx. It has
details on how to set various layers -- like emulating Win98 for a particular
program. It also discusses scripts and ways of distributing the compatibility
files.

Hope this helps,
- Carolyn Napier
Microsoft Windows Installer Team

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

MSI FAQ:
<http://www.microsoft.com/windows2000/community/centers/management/msi_faq.mspx>
 
G

Guest

Hi Carolyn,

Not quite what I am after.
If you run "regsvr32 C:\Winnt\AppPatch\SlayerUI.dll" this
will switch on application Compatibility and when you
right click on a shortcut, you can set what layer you wish
to run the application in.
What I am after is an MSI that will run the regsvr32
command and create a shortcut with the application layer
already set. Can this be done?
The problem is the msi will install onto a "lockdown"
users machine and they cannot run the regsvr32 command
above to enable the compatibility tab. Also, the file
LayerStorage.Dat is updated with the path to the exe that
the shortcut was pointing to.

Thanks.
Rhys.
 
C

Carolyn Napier [MSFT]

Of the environment that you mentioned, the following are easily supported by
MSI:

1. Support for installation on locked-down machines. See
http://msdn.microsoft.com/library/d..._with_elevated_privileges_for_a_non-admin.asp
for more details. Note that the AlwaysInstallElevated policy method is not
recommended because of the security implications of using that policy.

2. Ability to run a custom EXE or regsvr32 command, generally accomplished
through a custom action. Probably the most appropriate is a type 50 custom
action:
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/custom_action_type_50.asp).

The tricky part is having the layer automatically applied to the shortcut.
Here's where I feel that the application compatibility toolkit documentation
that I referenced earlier would help you. It allows you to create a custom
compatibility database and add your own appcompat entries to it. So, you simply
follow the instructions to add a layer (which is what you've described) and then
provide the application name and application file.

The instructions in the doc also describe how to deploy the fix as well. This
requires running the sdbinst executable and providing it the path of your custom
SDB (appcompat database) file. You could easily use a custom action to run the
command to install the appcompat database entry within the MSI file. The
appcompat framework will apply the layer to those applications that match the
entries you provided.

This method is fairly flexible, fully supported, and can be incorporated with
MSI for deployment (using the custom action mechanism). Some step-by-step
details are at:
http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/lgcyapps.mspx.

Hope this helps,
- Carolyn Napier
Microsoft Windows Installer Team

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

MSI FAQ:
<http://www.microsoft.com/windows2000/community/centers/management/msi_faq.mspx>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top