Different builds of SQLite in the same Windows Store app bundle - windows

I'm having a problem deploying an update of my app to the store.
The app runs SQLite, and I've recently discovered it throws an error on certain x64 architectures.
BadImageFormatException: An attempt was made to load a program with an
incorrect format.
I understand what this means. The x64 version of the app is using the x86 compiled version of sqlite3.dll. I can get around this issue and build an x64 version by the following method.
Open Project > Properties, and set Platform and Platform Target to x64.
Save
Open Build > Configuration Manager and set Active Platform and Platform (Release) to x64.
Build the project
Open Project > Store > Create App Packages and generate my package
This creates a correct x64 app package with the x64 version of sqlite3.dll
Following this for all three architectures (x86, x64 and ARM) gives me three separate appxbundle files. When I go to upload a new package to the store through the developer dashboard, I can only upload one of these.
If I open "Create App Packages" and choose all three architectures for my bundle, it generates a single appxbundle for all three. However when I unzip this appxbundle I can see that the x64 build is using the x86 compiled sqlite3.dll and not the x64 version.
I tried opening the appxbundle in 7zip and replacing the files, but 7zip could not write to the file, only read it.
I then tried unzipping the appxbundle and replacing each of the three builds with the correct builds from the singular appxbundles. I then zipped the lot together using no compression and renamed .zip to .appxbundle, but the store rejected this as an invalid file.
I'm guessing there's some kind of signing going on or a proprietary compression. To be honest I didn't expect that to work but it was worth a try.
How do I build the correct version of my app for each architecture and include it in a single appxbundle? Can I manually create my own appxbundle from separate builds?
SOLUTION
I have accepted crea7or's answer below, but I just wanted to expand on it a little
Using the MakeAppX.exe command line tool I was able to unbundle and rebundle my appxbundle file correctly, using the following command
// to unbundle
MakeAppX.exe unbundle /p MyPackage.appxbundle /d MyPackage
// to bundle
MakeAppX.exe bundle /d MyPackage /p MyPackage.appxbundle
A couple of handy pointers. Make sure you use the 8.1 version of MakeAppX, as the 8.0 version cannot bundle or unbundle.
C:\Program Files (x86)\Windows Kits\8.1\bin\x86\makeappx.exe
You'll save yourself a lot of hassle and typing if you simply add this path to your PATH Environment Variables in Advanced system settings. That way you can run MakeAppX from any location. This might seem obvious to people of my generation but not everyone is so familiar with DOS. =)
Visual Studio creates .appxupload packages, which according to this question, are zip files renamed as .appxupload. MakeAppX cannot create or unbundle .appxupload packages - you have to use a zip app.
However, any .appxupload package I created with 7zip did not validate when uploaded. Luckily it seems that the store will accept the .appxbundle directly, so I didn't need to zip it up at all, only bundle it. I've submitted this to the store. I'll report back if it gets approved.
update
the above appxbundle file was not approved, failed technical tests. I tried the zip approach again and it was accepted this time, again I'll report back if this passes.
To sum up:
c:\MyApp.appxupload -> [unzip] -> c:\MyApp\
c:\MyApp\MyApp.appxbundle -> [makeappx unbundle] -> c:\MyApp\MyApp\
c:\MyApp\MyApp\MyApp.appx -> [do whatever you need to here]
c:\MyApp\MyApp\ -> [makeappx bundle] -> c:\MyApp\MyApp.appxbundle
c:\MyApp\ -> [zip] -> c:\MyApp.zip
c:\MyApp.zip -> [rename] -> c:\MyApp.appxupload

You should use MakeAppx tool to create valid appx package bundle, because they are signed. Here is the tutorial about creating bundles.

Related

How to distribute Chromium binary after compiling? Directory has over 39GB

I want to distribute Chromium I just compiled. The problem is, just after compiling, the directory with the binary weights over 39GB!
How can I filter only needed for operation files? I think it should be at most about 1GB.
I am on Windows, and followed instructions from here: https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md
The directory in question looks like this: several subdirectories, and ~1400 single files in root.
Ideally I'm looking for specific guidline, including files and folders I must keep.
You have to distribute mini installer only which will be in your build folder as mini_installer.exe. You can build mini installer by executing the following command:
ninja -C out\YourBuildFolder mini_installer
Basically mini installer is just a packer which packs the following files:
setup.exe
chrome.packed.7z
More information on it can be found here. So executing mini installer will extract those files and execute setup.exe, which will then install your Chromium fork. Also, for distributing your fork, you should build release versions which you can specify when you run this command:
gn args out\YourBuildFolder
Basically it will open args.gn file located in out\YourBuildFolder and then you set:
is_debug = false
You might need those files and folders for debugging your Chromium fork as it includes the debug symbols, which are required for debugging.

Why does windeployqt output files that are not required, and how can I get rid of them?

I was informed about the "windeployqt" utility, which should be able collect all Qt/MinGW DLLs that are required to run my Windows Qt application properly. So I gave it a try.
Unfortunately I have noticed that it collects more files then neccessary. I compared the files collected by the windeployqt utility against the ones that are reported by the "Dependency Walker". The files that are really required have been collected properly, but also following files were collected for some reason:
Qt5Svg.dll
iconengines\qsvgicon.dll
imageformats\qdds.dll
imageformats\qgif.dll
imageformats\qicns.dll
imageformats\qico.dll
imageformats\qjp2.dll
imageformats\qjpeg.dll
imageformats\qmng.dll
imageformats\qsvg.dll
imageformats\qtga.dll
imageformats\qtiff.dll
imageformats\qwbmp.dll
imageformats\qwebp.dll
The application just deals with QBus and uses QWidgets to display a simple Window. Therefore I see no reason why these DLLs have been collected.
The fact that a DLL is no listed by Dependency Walker does not mean it is not required.
Dependency Walker will only list DLL required for you exe to be loaded and started by Windows. But other DLLs may be loaded later, while your program is running. This happens in particular when Qt loads plugins like the image format plugins
Because it cannot know beforehand what plugin will be needed, windeployqt deploys all Qt plugins (all which are relevant in regard to the required DLLs).
You can alter the way windeployqt behaves by using command line modifiers like --no-plugins (see windeployqt -help).
You can take a look at Qt for Windows - Deployment in the Qt documentation, in particular the part about Qt Plugins.
windeployqt utility will parse your "EXE" file and determine what packages were used, then it copies needed DLLs accordingly. Make sure to invoke the utility in a configured/set environment.
I use the utility in this way:
Perform release clean build of the project and record build path and "exe" generated. For insrance
c:\myApp\release\ and myApp.exe
Create deployment folder // other than the release build folder//. for instance
c:\myApp\deploy
then invoke the utility from Qt command line utility, as follows:
- Go to all progrmas --> Qt --> Qt command line utility
- cd c:\myApp\deploy
- windeployqt --dir . c:\myApp\release\myApp.exe

Bamboo unable to find framework corresponding to the target framework moniker?

I am trying to implement Bamboo into creating an IPA file or APK file using Xbuild but I am getting 1 warning and 1 error:
The warning is the following:
/usr/local/Cellar/mono/4.6.2.7/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: warning : Unable to find framework corresponding to the target framework moniker '.NETPortable,Version=v4.5,Profile=Profile78'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior.
The error is this:
/usr/local/Cellar/mono/4.6.2.7/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: error : PCL Reference Assemblies not installed.
I am unsure why this is happening because when I open the project in Xamarin studio and build it, it will be successful, and when I run it the app is fully functional with no problems at all. I have located the file location of the profile 78 in the version 4.5 and it exists, I have the latest installed version of Mono Development Kit (MDK). How can it build correctly in Xamarin but not in Bamboo, is it do with how I locate the files?
I have also tried to create the APK file on the terminal but got the same error as well. I have tried a lot of fixes like uninstalling mono and reinstalling, I added .NETPortable from windows to Mac but that didn't work, why can't my mac find the profile 78 it is located on my mac.
The file /usr/local/Cellar/mono/4.6.2.7/lib/mono/xbuild/14.0/bin/microsoft.common.targets seems to be looking for the .NetPortable,Version=v4.5,Profile=78 but I have that in this location: Library/Frameworks/Mono.framework/Versions/4.6.2/lib/mono/xbuild.frameworks/.NetPortable/v4.5/Profile/Profile78 and I have pasted the .NetPortable folder in multiple locations to try and fix this error. Where am I going wrong?
Although I have not touched Bamboo for quite some time(3+ years), one thing I personally do is to ensure your xbuild command works like a charm in a local environment with a similar setup. Seeing that you tried to create an .apk through the terminal and got the same error sounds like an installation error. The PCL Reference Assemblies should be apart of the MDK on MacOS. Seeing that you have it installed, it sounds like a potential issue with file permissions of the Bamboo user account.
To create an .apk file, you need to use the /t:PackageForAndroid target against your Android project when invoking xbuild.
EX:
xbuild XamarinAndroidApplication.csproj /p:Configuration=Release /t:PackageForAndroid
You can also use the SignAndroidPackage target given the notes here:
https://developer.xamarin.com/guides/android/under_the_hood/build_process/#Build_Targets
xbuild XamarinAndroidApplication.csproj /p:Configuration=Release /t:SignAndroidPackage
If you wanted to use the MSBuild equivalents, it would look like this:
msbuild MyAndroidApp.sln
msbuild /t:SignAndroidPackage MyAndroidApp.csproj

Bundle Multiple Xamarin apps in one pkg installer

I have few Xamarin apps and I want to bundle them all as a single pkg/installer and organize them into a folder under Applications similar to the following snapshot attached. Is there an option to specify additional Xamarin apps in the bundle settings of the project or any build script needs to be written? Can anybody point to some samples ?
Thanks,
Suma.
1. pkg installer: Packages
See Payload section to add folder and your .app files.
They also support Certification for signing Developer Installer and Commandline. Just check the documentation.
2. Automation Build script:
Use Packages to create .pkgproj file that config your bundle apps
Go Xamarin Studio -> Project Options -> Custom Command -> Add new Common After Build: add script to copy all bundle apps to a folder that configured by above .pkgproj file
Run command line packagesbuild of Packages to build the .pkgproj file
Finish. Get your .pkg installer file in Build folder.

freeswitch noob cant build solution

im just starting out with FreeSwitch, i downloaded via git, and am trying to build in VS
all i need i believe are the dlls of mod_managed, as my goal is to manage FS via .net
but i get 248 errors, most look something like this:
Error 5 error C1083: Cannot open source file: '....\jpeg-8d\jaricom.c': No such file or directory D:\FreeSwitch\freeswitch\libs\win32\libjpeg\c1 libjpeg
btw, i searched windows and cannot find any such file anywhere on my pc.
I tried
cleaning the solution first, but it did not help
moving the file to a path without spaces
downloading with autocrlf=false
building on another machine
but none of these steps helped
anybody have any idea?
if i can just download the dlls i need, i wouldnt mind skipping this step altogether
environment
win 8 64bit
visual studio 2012
thanks a million
The libjpeg sources are not in the git sources but are normally downloaded during the build process. If you build the entire solution that should not be a problem since it has the project dependencies set: libjpeg.2012 depends on Download libjpg.2012, which means the latter gets built before the first. All Download libjpg.2012 is run a cscript which downloads libjpeg from http://www.ijg.org/files/jpegsrc.v8d.tar.gz (see inside the project file).
So if you do not have the sources, either you are building incorrectly (not in VS for instance, or with a broken solution file) or the download script is broken. In that case, you should inspect the output: I assume it shows errors when it can not download the libs.

Resources