Change Installation Location of UWP app from Installshield

8.4k views Asked by At

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.

2

There are 2 answers

2
Jay Zuo On

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.

0
Michael Urman On

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:

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.