Why does System.IO.Directory.Exists return false when viewing Mac path in .net Maui? - .net-maui

I am building a .net Maui app which targets Mac Catalyst.
I implemented a folder picker from #GeraldVersluis
Folder Picker .NET MAUI
When choosing the folder the following path is returned:
pickedFolder = file:///Users/macminim1/Documents/Sorted%20Testing/
If I then use:
if (System.IO.Directory.Exists(pickedFolder))
{
}
The result is false.
Obviously, the folder exists as I just chose it and I confirmed it's existence in the file system.
Thanks in advance!

You could direct to this folder in the Terminal and use the 'pwd' command, this should return you the correct path. I think 'file:://' is not correct

Related

How to browse for a folder on OS X?

I've got a function in a Notes app running on the Windows Notes client which allows you to choose a folder into which files get downloaded. It uses a call to shell32. It, of course, won't work on a OS X. I found code to drop files into the TMP folder of Windows, MAC, and Linux which works. But I would rather it prompt for a folder and not just use the TMP folder. Anyone know how to browse for a folder on OS X?
thanks
clem
i think you can use OpenFileDialog method but you must have to select a file and then retrive his path removing the file name.

Getting App.nw location on OSX

We're building a node-webkit/NW.js application for OS X and want to create a updater for the application so that it will be kept up-to-date automatically.
Because we deploy the nodeJS, css and html in a App.nw package. It's quite easy to download a new package and just replace the old one and restart the application. After searching somewhat on Google we couldn't find any way of getting the location of the App.nw package on OS X.
We deploy a node-webkit redist on OS X but we use our own CEF client for Windows. On Windows it's quite simple, you just get the NW.exe path and work your way to the App.nw from there. Is there some way of doing that on OS X?
Also it might be good to state that we're working on an older version of node-webkit, version 0.8.6. This is because a lot of native modules don't work on 0.9+ of node-webkit because they need NodeJS 0.10.
While you are running your app your can do:
var path = window.location.pathname;
path = path.substr(0, path.lastIndexOf('/'));
That will give your the full path to the app.nw.
The answer is different depending upon whether you are working in a Terminal (command line) window or from Finder.
In OS X, the nw application is called nwjs. You can look around inside the application bundle by right clicking on the application and selecting the Show Package Contents menu item. Navigate to Contents -> Resources and you will see your App.nw file or directory there.
From the command line, go to the directory containing the nwjs app. It should have the name, nwjs.app. From that directory the file (or directory) that you want is nwjs.app/Contents/Resources/App.nw
When customizing your packaged application it is perfectly ok to rename nwjs.app to your_app_name.app. So the name of the app might be something different from nwjs.app.

windows phone 8 Cordova - placing a file in a different path

I am very new to VisualStudio and porting a cordova/phonegap application from android to windows phone 8.
So I created a new project using createTemplates.bat and imported it in my VS2012 Express.
The core result is one www folder containing img/css/js and index.html; it works fine and I manage to launch it and deploy on my device.
Because the application is quite big, I want to create a new sub-folder call subfold (under img), and placing picture.jpg in there so in solutionExplorer I have img/subfold/picture.jpg (even if it is hidden); but I cannot use picture.jpg while I can use it if it's in img.
How can I do that? Is it a limit of VS 2012?
I am 100% sure that I use the proper path.
Another notable thing is that in SolutionExplorer View, the subfolder and its content are disabled (look at "attivita" below) and Build Action property does not exist while it exists and set to 'Content' if the image is inside img
From the screenshot I can see that the icon for the folder is ghosted out, this means that the folder exists in the file directory, but isn't included in the Visual Studio solution. You can right-click on the folder and choose the option to include the folder in the solution. You may also need to add each of the items in the folders to the solution via the Solution Explorer.
you can use the absolute path for Windows Phone and not the www folder, this is what i have write for Android Windows Phone8 and iPhone
if( /Android|BlackBerry Mini/i.test(navigator.userAgent) ) {
//android absolute path
path = cordova.file.applicationStorageDirectory;
} else if (isWindowsPhone) {
//windows phone absolute path
path = "//";
} else {
//iphone absolute path
path = cordova.file.documentsDirectory;
}

Publish Windows form application - path too long

I'm trying to publish my application, but the bin\Debug\App.publish\ ect path is too long. I've found out that you can change this default path in web project by doint this c:\shortPath\ in the publish profile file, but i can't figure out how to do it for windows form application, i don't get any file i can edit. I'm using VS 2012
Thanks in advance!
Changed Output path in project properties-> build.

MonoTouch Enterprise - Deployment

Our firm has begun building MonoTouch iPad/iPhone apps for enterprise deployment.
How do I take the app and create a *.ipa file for upload to our MDM server?
An .ipa file is basically a glorified .zip file. There are a couple of routes you can go down:
Export the project to xcode and under "Build" click "Build and Archive" - fill in the appropriate details and the project should create the .ipa for you as expected.
If this isn't an option, (which it isnt for us, so this is the method I've used, to great success) you can simply create all the components that go into the .ipa and right-click, "Compress..." in Finder.
The .ipa is made up of the following components:
A folder named "Payload", which contains the compiled (release/iPhone) .app
a 57x57 .png icon file (which is displayed while the app is being downloaded)
a 512x512 .png file of the icon once again - however this has to renamed itunesartwork with no extension
iTunesMetadata.plist - this contains information about the app, such as copyright name, genre, itemname, softwareIconNeedsShine (you can google what information this needs).
The way I package up our .ipa, is I have a folder called "App Packaging" which has all of these components already in, and I simply update the .app file whenever we do an upload, "Compress..." then rename the file to x.ipa (OS X will ask if you want to use this extension, make sure you select ("use .ipa" !).
With the current Monodevelop (2.8.6.5) and Monotouch (5.2.5) it is as easy as right clicking on your project -> options -> iPhone IPA Options -> check Build ad-hoc/enterprise package (IPA) for the desired configuration.
We created a special configuration called Distribution which builds using the Distribution Certificate and In House Distribution Profile.
Luke, I like your answer and have given you the credit. I am adding some more details for my own, and others, notes.
Use SpotLight to find one of your own MonoTouch apps. Search on ".ipa".
Rename it to SomeThing.Zip
Unzip it.
You can then use the structure of the unzipped folder to edit then rezip.
Just another way to get an IPA that made it easy for me, drag your .app file onto your itunes library and sync your device. ITunes then creates a copy of the app as an .ipa file in the user/music/itunes/itunes media/mobile applications. This can then be distributed much easier than the .app file.

Resources