Locally deploy parallel versions of a Windows Store App - windows-runtime

I am developing a Windows Store App and I like to keep the most recent baseline installed while developing the next.
The problem is that whenever I run the current developmental version in Visual Studio 2013 (with F5) it un-installs the recent baseline.
I create and install a baseline by manually editing the Package.appxmanifest as follows:
edit the Identity Name
Append .R to every instance of the app name (eg. MyApp to MyApp.R)
(full file listing below)
I think that should be enough, but in my vain attempts to get this working I have also, in the project properties, append .R to the Assembly name, eg. MyApp.R, and changed one number in the MyApp_TemporaryKey.pfx
Then, when I run the app (F5) it is installed as MyApp.R, and persists and can be used outside Visual Studio.
The problem is that when I undo these changes to resume development, and run it again as MyApp then MyApp.R is uninstalled, and I am left with only the latest version, ie. MyApp.
I know that this is achievable because I have done it once before. I didn't record exactly what I did that time, because it didn't seem too hard, but after hours of trying I can't do it again. Either I haven't reproduced the steps correctly, or something has changed in Windows 8.1 since I last did it.
Why does Windows think the two versions are the same App? Is there another identity or key which I haven't changed?
Package.appxmanifest:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
<!--<Identity Name="8086b500-65af-4dd4-a67b-923c43472921" Publisher="CN=joedev_000" Version="1.0.0.0" />-->
<Identity Name="11111111-65af-4dd4-a67b-923c43472930" Publisher="CN=joedev_000" Version="1.0.0.0" />
<Properties>
<DisplayName>MyApp.R</DisplayName>
<PublisherDisplayName>joedev_000</PublisherDisplayName>
<Logo>Assets\StoreLogo.50x50.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.3.0</OSMinVersion>
<OSMaxVersionTested>6.3.0</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="MyApp.R.App">
<m2:VisualElements DisplayName="MyApp.R" Square150x150Logo="Assets\SquareLogo.150x150.png" Square30x30Logo="SquareLogo.30x30.png" Description="MyApp.R" ForegroundText="light" BackgroundColor="#464646">
<m2:DefaultTile Square70x70Logo="SquareLogo.70x70.png" Square310x310Logo="SquareLogo.310x310.png" Wide310x150Logo="WideLogo.310x150.png" ShortName="MyApp.R" DefaultSize="square150x150Logo">
<m2:ShowNameOnTiles>
<m2:ShowOn Tile="square150x150Logo" />
</m2:ShowNameOnTiles>
</m2:DefaultTile>
<m2:SplashScreen Image="Assets\SplashScreen.620x300.png" />
</m2:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

The Identify in the Manifest is the important part (in the visual manifest editor this is the "Package Name"). Changing the Identity is sufficient to allow both versions to be installed. You can also change the Identity to something meaningful rather than a GUID.
As you note, Visual Studio will uninstall the old version it has staged for you, but you can create a deployment package and install it again yourself.
When you are ready to switch to a new baseline use the Project.Store.Create App Packages... menu to create a development test package (i.e. not to upload to the store).
Update your manifest to use the new Identity. Changing the display names is not technically necessary but will make things less confusing.
Building this will install the new version and remove the staged version.
Now install the development package you created: go to AppPackages folder and run the Add-AppDevPackage.ps1 for the older version you want to reinstall.
You will end up with a normally deployed (in Program Files\WindowsApps) developer package of the old version and a staged (in your VS project directory) package of the new version.
(Alternatively, you can shuffle the versions to rename the old version to indicate it's old, create an app package for the renamed version, re-rename the Identity back to the original, and then install the dev-package for the old renamed version).

Try this if it works... Worked for me
Run the baseline application
Create a new working folder (or branch if you are using a code repository like TFS)
Eg : VS 2013 -> Projects -> App 1 then create VS 2013 -> Projects -> App 1-Copy
Change the Package Name in Package.appxmanifest under packaging tab in the new working copy
something which will be unique like changing the last couple of digits (to make a distinction between both the apps you can change the display name under Application tab and package display name under Packaging Tab)
and run the new application
this will list both your baseline and your development version
Hope this helps

Related

TKCustomMap Version Conflict

This issue has been reported on GitHub here -
https://github.com/TorbenK/TK.CustomMap/issues/325
Has anyone else has struggled with this? I was stoked to find this nuget package because it does exactly what I'm looking for but it needs Places and some other GooglePlayServices installed and I can't install them because of this conflict.
I'm also not sure if uninstalling TK.CustomMap and then installing the Play Services would even help because the person who reported the issue on GitHub said-
I converted my app to .net 2.0 and had to use the newest Google play services
60.1142.1 for AdMob to work. It wouldn't install until I uninstalled TK.CustomMap, and now TK.CustomMap won't reinstall because it only want to use GooglePlayServices 42.1021.1
Severity Code Description Project File Line Suppression State
Error NU1107 Version conflict detected for Xamarin.GooglePlayServices.Tasks. Reference the package directly from the project to resolve this issue.
HunterTracker.Android -> Xamarin.GooglePlayServices.Base 60.1142.1 -> Xamarin.GooglePlayServices.Tasks (= 60.1142.1)
HunterTracker.Android -> HunterTracker -> TK.CustomMap 2.0.1 -> Xamarin.GooglePlayServices.Location 42.1021.1 -> Xamarin.GooglePlayServices.Tasks (= 42.1021.1).
That's pretty much the exact error I'm getting trying to install the other packages. There's no resolution on github.
Anybody found a work around? Or does anyone know how to "Reference the package directly from the project"?
Thanks to SushiHangover's comments above pointing me in the right direction I was able to discover what I needed to do here. I had an error updating the nuget packages of TK.CustomMap at first because v26 Xamarin.Android.Support.Vector.Drawable was targeting MonoAndroid8.0 and the update to v27 must target MonoAndroid8.1 So it took quite a bit just to be able to update the nuget packages in order to get the assemblies with later versions so I could use TK.CustomMap in my solution. But I was eventually able to get there. Here were the steps I followed (as best I can remember). I am unable to compile ios right now because I don't have a MAC so that fix will have to come later. This fix is for the shared project and Android project only
Download the TK.CustomMap-master from github
Extract it and delete the Sample project completely (I also deleted the UWP project as I'm not really interested in that at this time)
Opened and built then closed. Deleted packages folder, vs folder, bin and obj from Android and Shared Project (this step is probably not necessary but I did it so...)
In the packages.config in Android changed all targets from monoandroid80 to monoandroid81 save file
In the TK.CustomMap.Android.csproj for every v26.0.1 of any Xamarin.Android.Support or other Xamarin.Android util package changed 26.0.1\lib\MonoAndroid80 to 27.0.2.1\lib\MonoAndroid81 - save file
In the nuget folder in TK.CustomMap.nuspec changed the target framework in this section
<group targetFramework="lib\MonoAndroid7.0">
<dependency id="Xamarin.GooglePlayServices.Location" version="42.1021.1" />
<dependency id="Xamarin.GooglePlayServices.Places" version="42.1021.1" />
<dependency id="Xamarin.Android.Maps.Utils" version="0.5.0" />
<dependency id="Xamarin.Forms" version="2.5.0.91635" />
<dependency id="Newtonsoft.Json" version="10.0.3" />
</group>
to
<group targetFramework="lib\MonoAndroid">
so it could target any version
Opened and updated all nuget packages using package manager (not console). Built debug and release builds
At this point opened solution I had tried to implement TK.CustomMap in previously to attempt the fix. Remember the original issues was that the latest frameworks could not be used and 42.1021.1 frameworks were unable to locate com.google.gms.location and com.google.gms.places.ui files so they had to be updated or no TK.CustomMap
In the problem solution uninstalled TK.CustomMap from all projects
In the problem solution Android project added reference to all the dlls in the release folder of the Android bin file from TK.CustomMap project.
Installed updates for all Xamarin.Android frameworks in problem solution through Package Manager (not console)
Installed updates of all other nuget packages for all projects using Package Manager (not console)
Installed TK.CustomMap to Shared project using Package Manager (not console)
Added the References to the android project a second time. May or may not have helped.
Installed TK.CustomMap Nuget Package using Package Manager (not console)
Built and ran on Live Player successfully!!
Thanks to Sushi Hangover for the advice. I haven't seen any comprehensive tutorials anywhere on how to accomplish this so I figured I would post my own answer in case anyone else was looking. Definitely if you are new to VS all this stuff is no walk in the park in the beginning.
Thanks to #Travis Fleenor. This is my solution. I change a bit your sequence in order to work on mine.
1. Make sure the original proyect from github (https://github.com/TorbenK/TK.CustomMap) works and you can run it.
2. Update the nugets where you get the conflict. In my case I got conflicted in googleplay library version. I updated it in the original proyect and then assure it could run it.
3. Compile entire solution in release mode. Then, copied the generated dll from bin/release and pasted them in a folder in my desktop.
4. I referenced those dll to shared proyect and android proyect. I only used nuget package manager to install some missing packages needed for the tk.custom. Notice that you only will reference some dll that the proyect accept. For the mayority Visual will prompt ' dll already referenced' something.
5. first reference your shared proyect, later your android one. That's all. make sure the you ca recompile solution.
Hope this helps

SSIS via MSBuild - Could not load ...DTSRuntimeWrap

I'm using the CodePlex-hosted Microsoft.SqlServer.IntegrationServices.Build project to build a DLL that contains the MSBuild tasks for building SSIS packages via MSBuild.exe.
I also am using an MSBuild proj file that's floating around the web.
More here:
https://speaksql.wordpress.com/2013/06/07/a-journey-to-db-deployment-automaton-ssis-build-using-msbuild/
I've opened the CodePlex project, disabled signing, switched it to 4.6.1 and built the DLL and corrected paths etc. and go it semi-working. However MSBuild spits this error:
Could not load file or assembly 'Microsoft.SqlServer.DTSRuntimeWrap, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
I've installed SSDT latest for Visual Studio 2015. I have various SQL Server editions installed on my dev PC. The DLL seems to be present; I've copied all I need into one folder for the moment.
Open the CodePlex project again and remove the reference to Microsoft.SqlServer.ManagedDTS.
Look on your local disk for the missing Microsoft.SqlServer.DTSRuntimeWrap.dll and note the version(s) you have available.
Now look on your disk for Microsoft.SqlServer.ManagedDTS.dll and note the version(s).
Re-add the reference but make sure you pick a DLL for which you also have the version of the 'wrap' available.
Now make sure those DLLs are (re)copied over into your working folder or whatever.
If you're still having problems, you may need to copy some files around so that MSBuild.exe can find them or edit/create a config file for MSBuild.
How to solve: Custom MSBuild task requires assembly outside of AppBase

Installing packages with nuget on command line on MacOS?

I'm trying F# on OS X and I'm having trouble installing packages. My problem is to use MySQL.
I have downloaded Nuget and I can launch it. However, I didn't find any useful documentation about how to use it on the command line.
I managed to install MySQL.Data by doing
mono nuget.exe install MySql.Data
which downloaded it to my current repository. Is that normal? I was expecting it to be "installed" in a more central directory.
Moreover, when I try to require it, r "MySql.Data it doesn't work. It works if I set the include path properly by doing:
fsharpi --lib:MySql.Data.6.8.3/lib/net45
But that seems super heavy. Is there a way to add all the installed nuget in the path automatically?
Short answer: No.
Long answer: Yes, but it won't be what you hoped for.
It is possible to get NuGet to put installed library some specific place. On Mac OS, add the following to the end of ~/.config/NuGet/NuGet.Config
<configuration>
<config>
<add key="repositoryPath" value="/path/to/where/you/want/it/to/go" />
</config>
</configuration>
However, (a) NuGet still puts DLLs in different directories, so there is still no single place for fsharpi to find them. (b) Anyway fsharpi doesn't honor $MONO_PATH, Mono's canonical way to add to the DLL search path.
The closest I've come to a workable solution for fsharpi is:
Whenever you nuget a package, manually add it to MONO_PATH (say, in ~/.profile). E.g., supposing you told nuget to put stuff in /opt/nuget you would add:
export MONO_PATH=$MONO_PATH:/opt/nuget/MySql.Data.6.8.3/lib/net45
Whenever you run fsharpi, explicitly feed it $MONO_PATH:
fsharpi -I:$MONO_PATH
If you feel adventurous you could then patch the fsharpi script to automatically include $MONO_PATH.
I find that this is not worth the effort. Simply constructing a script that starts fsharpi with the options you need for whatever you're currently working on is a much more practical solution.
I'm an F# programmer on a Mac. My life is like an illicit love affair with someone married: I endure all the little slights because my heart leaves me no choice.
The most common use I see is
mono nuget.exe install mysql.data -OutputDirectory packages -ExcludeVersion
Which would install in your project's directory (generally you ignore the packages directory in your repository however and just restore it with a script) and you'd then find it at packages/MySql.Data/lib/net45
Downloading nuget to your repository is also common.
You can always write your own script to do the the fsharpi hookups you want, nuget has a lot of convention, so it's possible to pick the right dll from lib/*/ for your purposes
And it's possible to do it with an fsharp script, here's an fsx script that can be executed directly, it downloads nuget, installs from nuget, and then executes another script (with fake not fsharpi, but that's totally possible.

How to properly update Monogame with a Github PR

Heey,
I got a little problem. The current Monogame 3.2 build available hasn't got a working template for Windows Phone 8. This will result into a black screen and a non working app. So I went onto their git hub and found the issue https://github.com/mono/MonoGame/pull/2089 and someone who fixed it and posted a Pull request.
The problem now is I have close to zero experience with building my own version or editing project template files. I got some common knowledge and started to delve into this all and already tried copying the template files to my visual studio files and building projects and throwing around the new .DLL but it all doesn't want to work properly. I started to work with the older template but I need the new version due to proper support for landscape in windows phone 8 that we need to utilize for our game.
Now is my question if someone knows the right/proper way to do this. A short summing up from what to copy where will do.
Thanks in advance.
Okay it took me some time but I figured out what to copy,build,set and run.
You download the .Zip or make a pull with your Github into an empty folder and when finished extract it.
In the map open the MonoGame.Framework or MonoGame.Framework.”your
target platform” which will startup visual studio.
Build the solution/project (don’t forget to build in ARM, x86 and
x64 if enabled and needed) and navigate to “Extracted
folder”/MonoGame.Framework/bin/”your targeted platform” at the same
time open a new explorer and navigate to your MonoGame installation
by default C:\Program Files (x86)\MonoGame\v3.0
Navigate in your extracted folder to your targeted platform and
build and copy the MonoGame.Framework.dll to the opposing C:\Program
Files (x86)\MonoGame\v3.0\Assemblies\”targeted platform”\”build”
Rebuild your Project/Solution
Gratz you now updated your MonoGame :)
This could fix your problem but it’s possible that you still get an error when initializing your app on your phone or emulator DXGI related.
If this occurs then follow these steps. The problem lies probably by your SharpDX.WP8.dll how to fix this? In my case download and install the newest SharpDX http://sharpdx.org/download/ you could also look further how to only download the SharpDX.WP8.dll & .winmd!
Navigate to your SharpDX install (by default C:\Program Files
(x86)\SharpDX) navigate further to
Bin\DirectX11_1-“platform”-“build”\ and copy the SharpDX.WP8.dll and
.winmd to C:\Program Files
(x86)\MonoGame\v3.0\Assemblies\WindowsPhone\”build”
Rebuild your Project/Solution (if this still doesn't work you may
need to manually add the references again to SharpDX.WP8.winmd for
both builds)
So if it’s alright this should fix most issues but there is one left. Between MonoGame 3.0.x and 3.2 the project template of a windows phone game has changed but this didn't went well in the code. So we’re now going to update the project template of our Visual Studio.
Go back to your extracted Monogame map and head into the folder
“ProjectTemplates”\”your visual studio version”\WindowsPhone
Select all files and create a .Zip (could be done by the integrated
windows option “Send To”) make sure when you open the .Zip you will
immediately see all the files and they aren't nested into a folder
inside the .Zip
Navigate to C:\Users\”your PC name”\Documents\Visual Studio
201X\Templates\ProjectTemplates\Visual C#\MonoGame and copy your
just created .Zip and overwrite the existing file.
You may have to follow these steps if you use different version of Visual Studio because of the lack of support for XNA inside VS2013.
Now you should've fixed any possible problem. If your project still gives errors try to recreate a new one (this would now use the new updated template you just copy pasted and would work) If this still doesn't work than please post what goes wrong but this all should do! These instructions should also work for all other platforms (at least which you could build of course)
Pretty easy to do pull it in to your own version.
Follow these steps:
Fork the Monogame repository
Clone your version to your local machine
Find the repository of the fixed code.
In a command prompt, move to your MonoGame folder, and pull the changes in using this line on your machine. (the branch is most likely master)
git pull http://github.com/other/repo branch_name
Once you have the pull request pulled into your local branch, just build it using Visual Studio.
You can also follow these steps if you think you'll be doing this often.
https://help.github.com/articles/syncing-a-fork
For some reason MrME, I couldn't get your solution to work because of some missing SharpDX reference which REFUSED to be added manually. While your solution may be valid I would like to present an alternative if you have the patience to transfer the code to a Monogame 3.2 project and are still getting the black screen:
Set the DrawingSurface to a DrawingSurfaceBackgroundGrid in the GamePage.xaml. Full details are found in the commented explanation at the bottom of the GamePage.xaml file.
Source: https://github.com/mono/MonoGame/issues/2081

How can I reverse-engineer an installer that was written with ghost-installer?

I have an installer for which I don't have any source code. I need to either "wrap" this installer or edit it to add a few more files. What's the best way to do this? As the title mentions, the installer was written w/ ghost installer.
Since it's not an MSI, you can't use Orca to edit the installer itself. And I have written custom install actions before as well for my MSI installers.
Since you don't have much control (if any) over your Ghost Installer, I would perhaps write a custom executable to supplement the installer, that can either run before or after the installer. This will create a few extra files to distribute to your customers, but you can distribute the entirety as a zip archive.
First of all, if you want to create an unmanaged bootstrapper the same way Visual Studio does to ensure prerequisites are installed, you can do it through MSBuild with a script like the following:
<Project ToolsVersion="3.5" DefaultTargets="BuildBootstrapper" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<BootstrapperFile Include="Microsoft.Net.Framework.2.0">
<ProductName>Microsoft .NET Framework 2.0</ProductName>
</BootstrapperFile>
</ItemGroup>
<Target Name="BuildBootstrapper">
<GenerateBootstrapper
ApplicationFile="CustomInstallerExecutable.exe"
ApplicationName="Pretty Title of Application Goes Here"
BootstrapperItems="#(BootstrapperFile)"
ComponentsLocation="Relative" />
</Target>
</Project>
This will produce a "setup.exe," which is the de facto file name for any bootstrapper of an installer. In fact, if you wanted to ensure the user didn't accidentally skip the bootstrapper and go straight to the installer, you could hide the Ghost Installer in a "bin" folder or something away from the root of the zip archive. That way, their only intuitive option is the "setup.exe." Include a "README.txt" as well if you need to be extremely clear for the customer's sake.
What this bootstrapper also does is make sure the client has the .NET 2.0 Framework as a prerequisite so that your "CustomInstallerExecutable.exe" can be written in .NET and not in an unmanaged language. In fact, this MSBuild script will plop down the .NET 2.0 Framework installer right beside your newly create bootstrapper (because of the "Relative" value of the "ComponentsLocation" attribute). There are other attribute values you can use that will facilitate the user getting the .NET Framework over the Web instead, if you are concerned about bloating the original download size of your Ghost Installer download to your customers.
Now your "CustomInstallerExecutable.exe" (written in beautiful, managed C#) can drop the extra files down on the machine before (or after) running the Ghost Installer. I have previously written some code to run an MSI from a .NET executable:
string msiString = "blahBlah.msi";
// Kick off Update installer
ProcessStartInfo startInfo = new ProcessStartInfo(
"cmd.exe",
"/c start /wait msiexec.exe /i " + msiString);
startInfo.WorkingDirectory = "bin";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
Process process = new Process
{
StartInfo = startInfo,
EnableRaisingEvents = true
};
process.Exited += new EventHandler(process_Exited);
process.Start();
I think you could do something very similar to call your Ghost Installer instead of an MSI. If you are running this .NET executable before the Ghost Installer, you can just invoke the Ghost Installer process and then exit your "CustomInstallerExecutable.exe" process and not wait for the process.Exited event to fire. This event waiting would be more for running "after install" logic.
Good luck and hope this is helpful.