Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Marketplace Client, Your Applications, and Registry Key

12 Oct 2009   #1

Marketplace Client, Your Applications, and Registry Key

The Windows Marketplace for Mobile is off to a great start since its release October 6th. One issue that has tripped up a few developers submitting their applications has been the use of internal registry keys used to determine the location of the application. Some clever developers have discovered that there is a list of installed applications stored in the registry under: HKEY_LOCAL_MACHINE\Software\Apps. Under the application name, you will find the directory in which the application has been installed. For example:

HKEY_LOCAL_MACHINE\Software\Apps\Company Application NameInstallDir=”\Program Files\Application Name”
a similar list can be found here:

[HKEY_LOCAL_MACHINE\Security\AppInstall\Company Application Name]InstallDir=”\Program Files\Application Name”

Since Windows Mobile does not support the concept of a current working directory, this has been one way to determine where the EXE is running from. A better approach, that is not dependant on these registry keys,  uses the following code (See Chistec’s blog post):

GetModuleFileName(GetModuleHandle(NULL), pszFullPath, MAX_PATH);

For managed code (See Chistec’s blog post):

using System.Reflection;private string GetApplicationExe(){ // Determine the full path to the application executable return Assembly.GetExecutingAssembly().GetName().CodeBase;}You can then parse out the application path from the returned file name.

So what is wrong with using these undocumented registry keys? When your application is installed by the Marketplace client, it creates these registry keys, but not with the names you would expect. Therefore, if your application is relying on any of these keys, if will fail to find them, because they will not exist.  This has tripped up a few developers because this issue does not surface unless you install the application after it has gone through the Marketplace ingestion process. (The processing of your application after it has passed certification testing.)

To summarize, if you need to get the directory in which it was your application was installed, use either the native or managed APIs above. Also, make sure you are not using either of these undocumented registry keys.




My System SpecsSystem Spec


 Marketplace Client, Your Applications, and Registry Key

Thread Tools

Similar help and support threads
Thread Forum
BOSD downloading virus removal tool and client registry error
I got the BSOD while working tonight and, while trying to find the root of the problem, have narrowed the problem down to the Kaspersky virus removal tool (free download). The original BSOD wasn't caused by that program, but every instance since is only the result of downloading that file. Upon...
BSOD Help and Support
How to export a registry settings for some applications?
Hi, can you please, explain how to export a registry settings for some applications (in my example only for Windows Sidebar-Gadgets and Windows Mail)? Are all of the registry keys for those applications in HKEY_LOCAL_MACHINE i.e. or man must some more registry keys export? Thx.
General Discussion
registry access through Cisco Anyconnect client
I have an application that works without issue through a Cisco Anyconnect client on XP and Vista, but not on Windows 7. It also works on Windows 7 when accessed locally (no Cisco Anyconnect client). When I try to use it on Windows 7 through the Cisco Anyconnect client, I get an error message...
General Discussion
Mail Client location in registry
Hi, I want what is the location of mail client in windows 7 registry. If any one knows give the path. I want to know the default mail client in windows 7 registry. Thanks in advance.
Browsers & Mail
Relax, Office 14 client applications will not have ads
Some folks are up in arms over what Microsoft Business Division Chief Stephen Elop said today during a presentation to analysts at the Morgan Stanley Technology conference: "There will be ad-based revenue streams. There's an opportunity to draw those pirate customers into the revenue stream. We...

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 12:43.

Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App