How to check Apple Application Support is installed on Windows? - itunes

I have a program depends on an open source library called libimobiledevice, this library depends on Apple Application Support, and if that was not installed, my program will be crashed without friendly prompt message. So I'd like to add a front-end program, when it starts, check Apple Application Support is installed, and if that was not installed, I will provide a message like "iTunes installation's required" to tell user.
P.S. I am using GCC C/C++.

I've finally found a way by query registry on Windows:
#include <windows.h>
bool AppleApplicationSupportIsInstalled(){
return RegQueryValueA(HKEY_LOCAL_MACHINE, "Software\\Apple Inc.\\Apple Application Support", NULL, NULL);
}

Related

How to get VB.NET for Mono set up?

I'm trying to get a Mono development environment set up on a Windows box. Basic install was dead simple, but I'd like to get the VB.NET compiler set up. Only problem is, there doesn't seem to be an installer for it. The official page on VB.NET support implies that there should be, but there isn't; it hasn't been incorporated into the main installer, either. I can download the source package from the mono-basic Github, but since the compiler is self-hosting, that just leaves me in a catch-22 situation where I need the compiler to compile the compiler... :/ On top of which, it doesn't look like the compiler code has been touched in a couple years...is this still supported? Is there any way to get it set up apart from doing a build from source on a machine with the official VS toolchain (or a Linux box with the package installed from a repository) and then copying it over?

Problems with cygwin build dll for use in windows app

I use Cygwin to build source code to DLL used by windows app.
When I use GCC core / GCC g++, the app crash if it calls function (which includes printf or malloc) in DLL.
When I use Mingw64-x86_64-gcc-core / Mingw64-x86_64-gcc-g++ it reports error like sys/socket.h:No such file or directory.
Can anyone explain how to do it? Thanks.
The first problem is due to the tentative to build a stand alone DLL (not depending on cygwin1.dll) using cygwin only specific tools.
You have collision between multiple malloc and other C library call present in cygwin1.dll.
The second is due to the fact that sys/socket.h does not exist on Windows
see for possible solution:
Using sys/socket.h functions on windows
So you need to define what is your target : Cygwin/Posix or Windows and choose programming style and tools accordingly, you can not mix.

What will happen if a framework get deleted from an app?

I was asked a question, what will happen when a framework is accidentally deleted from your device may be iphone or mac?
Whether your application crash or it will work without any error?
Please provide me answer with explainations.
You may get linking error. If framework folder is inside the application means its runtime linking.
OS X embeds an "install name" inside each dynamic library. This
install name is the path to where the library can be found when dyld
needs to load it. When you build an application that links against a
dynamic library, this install name is copied into the application
binary. When the application runs, the copied install name is then
used to locate the library or framework.
$ otool -D /Applications/Google\ Drive.app/Contents/Frameworks/Python.framework/Versions/2.6/Python
/Applications/Google Drive.app/Contents/Frameworks/Python.framework/Versions/2.6/Python:
#executable_path/../Frameworks/Python.framework/Versions/2.6/Python
so if you will delete Frameworks folder you will get Dyld Error.
Dyld Error Message:
Library not loaded: #loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle
Referenced from: /Applications/Transmission.app/Contents/MacOS/Transmission
Reason: image not found
If a framework is deleted, only software linking to that framework would be affected.
If it is a system framework, expect your system to start failing.
If it is a 3rd party framework, it should be limited in scope of impact.
If it is in your app bundle, and your app is code-signed, the removal of the bundled framework should prevent your app from launching.
It depends on if the application needs access to the framework you have removed.
If you application requires the framework then it will not compile.
If you dont need it, it will just compile like normal.

Detect Desktop availability from Metro application (detect ARM, detect Windows RT system)

This is a question related to Get OS-Version in WinRT Metro App C# but not its duplicate.
Is there any option to detect from a Metro application whether there is the desktop feature available on the system? I understand that detection of the OS version is not supported and that is OK imo.
However my metro app needs to know whether there is a Desktop available on the system it is running on.
By Desktop I mean extendable desktop - desktop, where 3rd party desktop applications can be installed. As we know ARM based units will have the desktop too, but only with Microsoft built-in programs.
Can I distinguish whether my Metro app is running on a ARM based tablet with non-extendable desktop vs on all other (Intel based) devices with extendable desktop?
After some more extensive search I found GetNativeSystemInfo method. The hint was right away on SO site - this question. This approach seems to be fully supported by Windows Store applications - the App Cert Kit test ran smoothly despite the fact that pinvoke was used.
I ended up with the following code:
[DllImport("kernel32.dll")]
internal static extern void GetNativeSystemInfo(ref SystemInfo lpSystemInfo);
internal static bool IsArmBased()
{
var sysInfo = new SystemInfo();
GetNativeSystemInfo(ref sysInfo);
return sysInfo.wProcessorArchitecture == ProcessorArchitectureArm; //ushort 5
}
This seems to be as a solution I was looking for. Please tell me if not or make me aware of whatever problems connected to such an approach. Thank you.
If this is HTML, you can use window.cpuClass to get if it's ARM, x86 or amd64.
A non dynamic version is to use target specific architectures rather than AnyCPU, and then use the flavours with #ifdefs to hard code it at build time. You have to submit 3 packages to the store, however.
Use a try {} catch(){} to access those libraries, if anything goes wrong assume the ARM version.

How to Compile iOS programs in Windows

I've recently learned some basic Objective-C and have made a really simple "HelloWorld" application for development on iPhones (not through the AppStore, but Jailbreaked iPhones)
I've got my main.m file and Classes in my HelloWorld directory.
I have GNUStep Shell installed on my Windows Machine, the real question is:
How do I compile my HelloWorld Application so I can send it to my iOS device.
I really just want to get the compiled files and SSH it to my /Applications/ Directory to test it.
How can it be done? Thanks.
EDIT:
Alternatively, is there a way I can upload the SDK headers to my iPhone using SSH and compile my program on my iPhone?
Thanks.
Possibly it will be much more comfortable to use virtual machine with mac OS. In this way you will full development toolbox including debugger, leak tester and so on.