Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Installation Location of UWP app from Installshield

I have created a WPF desktop app and generate MSI build using Installshield. I have created an MSI setup to install my app in C:\MyApp\ location instead of using program files. It is working fine as expected.

Then I have generated & tested a UWP app using the same InstallShield project. Installshield 2016 supports Desktop Bridge integration to do this - http://learn.flexerasoftware.com/IS-WBNR-InstallShield-2016-Whats-New.

I have noticed that the UWP app installed in the default location (C:\Program Files\WindowsApps) instead using the location defined in Installshield.

I want to change this location from my InstallShield project. Please help me to find a way to resolve this problem.

like image 549
Rajkumar G Avatar asked May 29 '17 15:05

Rajkumar G


People also ask

How do I distribute my UWP app?

If you are distributing your app via the Microsoft Store, Visual Studio can associate your package with the Store. To do this, right-click your project name in Solution Explorer and choose Publish->Associate App with the Store (before Visual Studio 2019 version 16.3, the Publish menu is named Store).

Are all apps in Windows Store UWP?

All apps ARE NOT necessarily UWP apps. Windows 8.1 apps do run on Windows 10, just not the other way around. Not every company or indie developer has updated their apps to support UWP.

What can be used to deploy UWP apps?

Microsoft Visual Studio allows you to deploy and debug your Universal Windows Platform (UWP) apps on a variety of Windows 10 devices.

Can UWP apps access registry?

You can't access registry within pure UWP platform directly. However, you can read registry values from a Win32 runFullTrust background process launched from a UWP application, and you can write values in registry from an "elevated" Win32 application launched from that runFullTrust process.


2 Answers

For UWP apps, we can't change their install location while installing.

As you've known, by default UWP apps will be installed in C:\Program Files\WindowsApps. you can the default install location in SettingsSystemStorageChange where new content is saved. enter image description here
You can choose one drive from the drop-down menu under "New apps will save to" and then click Apply. A new folder called "WindowsApps" will be created in the drive you've chosen. And any new UWP app will be be installed in this folder. Please note Windows 10 will only install new apps to the currently selected location. Existing apps do not get moved to the new location.

If you want to change the install location for a single app, you’ll need to head to SettingsApps & Features then click the Move button. enter image description here
However, this is only available after you have installed the app and it can only move the app to another drive. There is no way to specify the install location to some other folder like C:\MyApp\ etc.

like image 186
Jay Zuo Avatar answered Sep 18 '22 20:09

Jay Zuo


This is a bit of an XY question so this answer may not be clearly related to the asked question.

Knowing the location that a UWP app package does not help in the least. It's fine for exploring the system as a developer, but it's nigh useless for a released app. Instead you need another way to launch your app.

UWP offers a handful of ways to start your app:

  • Use a protocol (i.e. a custom scheme in a URL)
  • Use an alias (i.e. an alternate command-line program name)
  • Use API (IApplicationActivationManager::ActivateApplication)

The first two of these require modifications to your AppxManifest. Since InstallShield doesn't put this front and center, it offers alternate ways to populate these parts of the manifest. (The third instead requires modifications to the code that would invoke this app, so I won't discuss that further.)

Protocol

To populate a protocol handler from InstallShield, merely add the protocol handler to the registry. When building the AppxManifest, InstallShield will read this registration and translate it into the manifest's protocol entries.

Alias

To populate an AppExecutionAlias from InstallShield, merely an App Paths registry key for each relevant entry point. An App Paths registry key is installed to HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths, and you should use the following format for your alias:

HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\<alias.exe>

(Default) = <path\to\your\exe>

For simplicity, your path should probably use either property references ([ProgramFilesFolder]Company Name\Product Name\executable.exe) or component references ([$componentid] - typically executable.exe or NewComponent23). When building the AppxManifest, InstallShield will read this registration and translate it into the manifest's alias entries.

like image 35
Michael Urman Avatar answered Sep 21 '22 20:09

Michael Urman