I am looking for a way to combine all my "Applications" references into a common directory inside the AppX package. The project types of the references are standard Visual C++ (Win32) projects. The current structure of my solution is as follows:
Solution Structure
* Solution
|__ Exe_1 (Visual C++ Project)
|__ Exe_2 (Visual C++ Project)
|__ Exe_3 (Visual C++ Project)
|
|__ MyApp (AppX Project)
|__ Applications
| |__ Exe_1
| |__ Exe_2
| |__ Exe_3
|___ Images\
|___ Package.appxmanifest
After publishing the solution and deploying the AppX package, I get the following directory structure:
[ Actual ] Deployed AppX Directory Structure
Com.MyApp.12107._cx40ttqa_n3.48019.0_x64zyj5
|__ Exe_1\Exe_1.exe
|__ Exe_2\Exe_2.exe
|__ Exe_3\Exe_3.exe
[ Expected ] Deployed AppX Directory Structure
Com.MyApp.12107._cx40ttqa_n3.48019.0_x64zyj5
|__ Exe_1.exe
|__ Exe_2.exe
|__ Exe_3.exe
What I tried
What I want to achieve
A similar result to how Apple managed to pack iTunes' related files in the root app directory.
UPDATE #1
I've edited the MyApp.wapproj
file in the AppX project and modified the following lines:
<ProjectReference Include="..\Exe_1\Exe_1.vcxproj">
<OutputItemType>Content</OutputItemType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</ProjectReference>
With the modification in hand, the EXE is now only copied but not used as a real entry point. The case is similar to the Post-Build Event method.
As of time of writing, Visual Studio 2019 (v16.6.4) doesn't offer a built-in option to change output paths for referenced "Applications". Alternatively, you have to revoke all Applications references from the projects and append the following under the imports of the assets in your .wapproj
project file:
<Content Include="..\Path\To\Your\Exe_1\Exe_1.exe" />
<Content Include="..\Path\To\Your\Exe_2\Exe_2.exe" />
<Content Include="..\Path\To\Your\Exe_3\Exe_3.exe" />
Additionally, you will need to replace the the tag <EntryPointProjectUniqueName>
with <EntryPointExe>
since we're not dealing with referenced applications anymore (at least in the author's case.)
<EntryPointExe>..\Path\To\Your\Exe_1\Exe_1.exe</EntryPointExe>
Finally, you will obtain an output similar to the expectation stated by the author after deploying it to a machine.
Feedback from Microsoft
As you can imagine there is a reason that we do this and the primary concern is duplicate filenames as well as some issues with uploading to the store. As of now there is no override that we provide that will allow you to achieve this although there are some hacks you could do to make it possible but it is not advised.
Scoban [MSFT]
The discussion can be found here.