How to merge dependency into .Appx to avoid -DependencyPath argument - windows-10-universal

I have a large win32 program consisting of a mixture of native and managed code.
I would like to put it into a single .Appx file for simple installation on Windows 10. I don't want to put it in the Windows Store - I simply want to replace the old installer with an .Appx file.
Using the DesktopAppConverter I have converted the program to an .Appx.
My problem is that the DesktopAppConverter adds a dependency on 'Microsoft.VCLibs.140.00.UWPDesktop' which means that I have to distribute both my .appx and Microsoft.VCLibs.x64.14.00.Desktop.appx. So the user can no longer just click my .appx file but has to run this from PowerShell:
Add-AppxPackage .\MyApp.appx -DependencyPath .\Microsoft.VCLibs.x64.14.00.Desktop.appx
Is there a way that I can "merge" the dependency into a single .appx that the user can just double click to install?

Microsoft documents support for appx bundles, you could try that.
Another option, more risky, would be to assume that such a dependency is already present on the machine (it is quite common so it might be installed by other packages from the store). In this case you can edit your appx package and remove the dependency from it.
Advanced Installer can import appx packages and provide an easy to use GUI to edit their content, with just a few clicks you can remove/add your dependencies.
Advanced Installer UWP support - dedicated GUI editor for package contents, convert from old MSI/EXE to UWP, create UWP and WSA packages...
Disclaimer: I am part of the team building Advanced Installer over the last 14 years.

Related

Application Settings in .Net Core (WPF) and single exe

To migrate an application I want to continue using the plain old settings that still come along with .Net5 (App.Config, Settings.settings and so on).
I need a simple built in solution without additional dependencies.
The proposed way seems to be appsettings.json or similar.
For that to use with WPF you need to add some additonal dependencies which bloat the project when
publishing it as single exe (not self contained). It is over-the-top for simple applications.
I followed the steps here:
Equivalent to UserSettings / ApplicationSettings in WPF dotnet core
The accepted answer from Alexander works for a normal exe built.
These are the generated files
MyApp.dll
MyApp.dll.config
MyApp.exe
Modifying "MyApp.dll.config" with an editor directly reflects the changed data in the code.
MessageBox.Show(Settings.Default.SomeConfigValue);
The used config file can be displayed using
var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
MessageBox.Show(config.FilePath);
It displays
C:\Projekte\MyApp\MyApp\bin\Debug\net5.0-windows\MyApp.dll.config
Unfortunately this fails for single exe
These are the generated files (in publish folder)
MyApp.dll.config
MyApp.exe
Modifying "MyApp.dll.config" or "MyApp.exe.config" has no effect. The file does not seem to be used by the framework.
Above messagebox now shows
C:\Projekte\MyApp\Publish<Unknown>.config
How to get the built-in configuration system work with single exe?

How can I deploy an application to Hololens without VS?

I've developed an application for Hololens, so the only way I know to install the application in hololens is by visual studio, so I want an application package to be able to install without needing Visual Studio. I tried to follow this tutorial here
"https://learn.microsoft.com/pt-br/windows/uwp/packaging/create-app-package-with-makeappx-tool"
but I can not find these two .appx and .appxsym files.
If anyone knew, I appreciate that.
Maybe you know some steps, but I will go the full way (it's only deploying without visual Studio):
In Unity:
File> Build Settings
Choose Universal Windows Plattform (older Versions Windows Store). Make sure your settings are right (for hololens, sdk enabled...)
hit "Build"
Now you have to select a Folder to build. In my Projects I create just an "App" Folder
Once it is build navigate to this Folder (if it's not opening automatically).
Open the Solution (in the App Folder, not the Unity one)
In the Explorer right Click on the "Project Properties" which are named like your Project and Select "Store>create App Package (or maybe build, i got it on German)"
If you want only the appx File select "no" at the Windows Store question
Select an Output Folder and Version Number (count's up itself, newer numbers will overwrite older versions on Hololens automatically) and for Hololens only select x86 (the others are not needed. Just consume time). Now hit the "create"(again i hope i translate it right) Button.
Apply on Hololens:
Connect the hololens via USB (you can do it with wifi too, but not in our Network, so i never tried)
Open a browser and type "127.0.0.1:10080" so you get access to your hololens
Navigate to "System>Apps" and under Install App select the appx file (in my case under: (myUnityProject/App/AppPackages/myUnityProject/myUnityProject_1.0.0.0_Win32_Master_Test)
First time deploying select the dependencies (Dependencies/x86)
Hit "go" to Deploy (wait until everything is uploaded)
Some Notes:
To build the Apps i needed mvs 2015 installed (just installed), but this was before the Fall creators Update. Now newer Versions (should) work fine. Also I needed to install the windows "buildtools 2015"
https://www.microsoft.com/de-de/download/details.aspx?id=48159
Hope it works and have fun!

Checking installation integrity with installshield

For Linux packages, specifically RPMs with stored checksums, we always can check two things: the contents of package is ok and the installation from this package is ok. When someone modifies parts of the installation he shouldn't, we can see it by running rpm -Vp my-precious-package. In our busyness it is not only recommended, but obligatory to provide our packages with tools for this purpose and for Linux these are just simple bash scripts.
Now I have to do something similar for Windows. Basically what I want is to provide some batch file by running which one can get assured, the installation is the same as it meant to be in the package. I'm using InstallShield for packaging, and yet it has some great visual tools, I still haven't found a way to verify package checksums in the command line.
Is it even possible, or should I reinvent the wheel writing my own checking utils?
Take a look at MakeCat and SignTool from Microsoft, both in SDK
http://msdn.microsoft.com/en-us/library/windows/desktop/aa386967%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/aa387764%28v=vs.85%29.aspx
Windows Installer has a feature called resiliency that supports auto repair of products and there are ways to call it for self checks only. (This is assuming by InstallShield you mean Windows Installer based projects.)
Here's a couple links to read to get you started:
INFO: Description of Resiliency in Windows Installer
Resiliency
Application Resiliency: Unlock the Hidden Features of Windows Installer
MsiProvideComponent function (See dwInstallMode flags)
This also assumes all files are key files. Companion files are not managed by the installer. Also changes performed by custom actions outside of the installer aren't managed.

Does every form and/or console application require installation?

Let's say that I have created a form or a console application. This form application's only dependency is .NET Framework (not a 3rd library) and application doesn't have any kind of requirements. What it does is to take a file and transforms to something else.
Does this application need to be installed? Can I just copy .exe file that is under \bin folder and share it?
First, you need to make sure that Copy Local is set to true for all the references of your start up project. Setting copy local to true will make sure that the DLLs get copied to the output directory. Then, build the solution and copy all the files from your output directory to any machine where you want to run the application. The application should work, as long as it has the appropriate .NET framework installed.
Here's a link about how to set copy local to true: http://msdn.microsoft.com/en-us/library/t1zz5y8c%28v=vs.100%29.aspx
There are 2 Ways to Do This... I just did this 20 Min Ago :)
Method 1 : Right Click on Your Project, Publish, Choose Location For
The installer. This installer can be copied onto other machines, installed and run
Method 2 : Your bin/release folder will contain .exe files which need to be copied and Installed, i prefer the 1st method. It avoids missing important / Needed Files for execution
Just a Side Note. Make Sure the Output Type Is of Console Type (Right Click on project... Output type...), Some windows applications give Problems when Publishing and Installing them due to the frameworks that might be missing

Create Software Distribution Packages From Visual Studio

I would like to setup an automatic software distribution process, preferably from Microsoft Visual Studio, which builds my projects in all the different configurations and platforms, and packages all the created objects in a predefined folder tree structure.
The software distribution packages would be for Windows libraries and WDM driver projects written in C/C++. Each library has several different configurations (i.e. Windows 7 Release, Windows XP Release, MT/MD runtime compilation flags) for different platforms (i.e. x86 and x64). A similar thing is with the drivers. Without any automatic process to create a software distribution package, it's necessary to build all the different configurations for each platform and then copy the created objects to a predefined folder structure and then zip the created folder giving it a release name and version. This process is quite time consuming and error prone. Therefore, my goal is to automate this process using a clean a nice solution.
I've been researching about this for a few weeks already and have actually implemented a few different solutions. However non of the solutions I implemented until now is flawless whatsoever. Hence since this should be a problem that I guess many developers have already encountered, I would like to hear different opinions on what would be a nice and efficient way to do it.
Up until now I've tried the following:
A batch script and a Makefile to be used by NMAKE. This is not so good because it makes difficult to set the same build parameters that are set on the visual studio project.
Implemented a "deploy" target task (editing the .vcsproj files) which calls MSBuild of the project for each configuration/platform and copies the generated files to a distribution directory. This has the advantage that I can start the deploy activity from within visual studio but it also produces several environment variables problems, specially when building windows drivers.
Any ideas or suggested solutions will be appreciated.
Thanks in advance.
Zion
If you haven't already, add a post-build step for each lib and driver which copies the built files into your specific tree and also zips them.
If you haven't already, create one Visual Studio solution (.sln file) which builds all these projects at once.
If you haven't already, set up Build configuration using the Build | Configuration Manager dialog. Now from the IDE, you should be able to specify a specific configuration and do a Build | Rebuild Solution and make sure all the projects are successfully built.
From the command-line, you can now automate #3 by opening a Visual Studio command line prompt (which sets up the environment variables appropriately). Start devenv.exe with appropriate command-line parameters.

Resources