Mac .Pkg File Opened In Windows...Strange Happenings - windows

I am a windows developer and I had to port an app to Mac. I built it fine and have everything working except my installer. I built my Package file (.pkg) which installs fine and works great on a Mac.
However, I want to move the file to a windows OS over a network to upload it to an ftp server. My ftp client is on Windows. I have done this before without issues on previous .pkg files but I just created one that is acting strange. When I view most .pkg files in windows explorer, they are treated almost like an unknown file type. Windows lets me see the file but I can't really do anything with it. This is fine because I just want to move the file, not use it in any other way.
Unfortunately, I have a new .pkg file that windows strangely treats like a directory instead of just a single file. I can open it and see the "Contents" folder and some internal files/binaries/whatever that I don't want to see. While this is similar to the MacOS functionality, it causes problems because it is uploaded as a directory rather than a file. I just want to drag it to my server and let people download it. Why is this happening?
I have looked online a fair amount and nobody seems to have this issue. It does seem to be permissions related. I saw a good amount of people complaining about "Custom Access" and oddly enough, when I click "get info" on the file, it does say I have "custom access". .Pkg files that seem to display correctly in windows explorer do not have this set. Anyways I would really appreciate the help. I could probably just get an ftp client on the Mac but this does seem really strange and it may help others if there is a solution.

Historically, Mac OS X installer files have been built as bundles, or a directory that appears as a file in OS X. These types of installers will always appear as directories in Windows. However, Mac OS X 10.5 added support for a new format, which is simply the important parts of the installer compressed using xar. Since this format is an archive and not a bundle, it will show up as a single file in Windows.
PackageMaker can produce either format depending on the minimum target version you specified for the package. If you specify 10.5, it will create the new xar format, but if you specify an older version, it will create a bundled installer. If your application will only work for 10.5 and later, you can change the minimum version in PackageMaker by going to Project > Install Properties (Command+I) and changing the Minimum Target dropdown. If you want to support older versions of OS X, then your only choice is to create the bundle version and either compress it as a zip file, or create a disk image to hold it.

Related

how to run a self-contained asp.net core api in Mac Os

At first I have to apologize that I know it's a stupid question but since I don't have Mac computer so I can't test it as well, and I also failed to find document in Microsoft about the actions after publish, then I reach here to gather a confirmation from wise SO contributers.
I have an asp.net core project and I published it as self-contained application. When I choose the target OS as windows, then I will get an EXE file in the publish folder, then in a windows OS without .net runtime, I can still run the app by just double clicking the exe file.
Okay, then here's the question, when I choose the target OS as osx-x64, I can get a file like screenshot below. Then if I have a Mac computer, how can I run this File? The Mac wouldn't have .net runtime, and at first I think this app may also can be run by just double clicking the file. Am I right? Or it should be run within a command line like cd xxx first then ./filename?
Thank you very much in advance for your confirmation.

How to generate an installer package for Mac app?

How can I create a single installer package for an OS X binary as well as a few configuration and script files?
Final folders should look like this:
Any help would be appreciated. Thanks.
Installers are great if you want various things to be placed in different spots – app here, documentation there, support files over here, etc. They're also great for providing configurability of the installation experience (optional extras), or hand-holding for an unusual type of installation that the user might not otherwise understand, or extra work (configuration scripts, permissions modifications, authentication, compatibility checking, etc.) that need to run during the installation process. There is nothing wrong with installers, contrary to the answer from #d00dle, although there is also nothing wrong with distributing your app through the App Store, or as a dmg.
For setting up your own installers, I highly recommend a program called Packages (http://s.sudre.free.fr/Software/Packages/about.html). I am in no way connected to it, but I use it to build the installer for an app that I work on. It greatly smoothes the process of making a complex installer, and has an excellent GUI interface.
There's also macOS Installer Builder, which is a CLI you can use to create an installer wizard for your .pkg: https://github.com/KosalaHerath/macos-installer-builder
macOS does not normally use installers. Applications are packaged in app containers with the extension .app. This container is "executable" but you're also able to dig in and see what is inside. This is also the format distributed through App Store.
You can create .pkg or .dmg "installers" if necessary, however this is clearly not something apple aims to be standard. I would advise to use the .app pattern and any scripts needed should be self contained and executed on first run.
You can use .dmg to distribute your application outside of App Store (this is still fairly normal).
macOS also includes a terminal program called productbuild that builds a product archive for the macOS Installer or the Mac App Store. Enter man productbuild into the Terminal on a Mac for the manual page.

qt program deployed on mac. config file not writing when standalone app launched, works when run from within qt creator

I have a program that I have developed for mac osx. When the program is run from within Qt creator, a log file and a config.cfg file are created in the myapp.app/Contents/MacOS folder, alongside the executable. This is the correct behaviour, the program needs these files.
When I deploy the app to run standalone (by linking the required libraries using macdeploymentqt tool) the app launches and runs correctly however the log and config.cfg file do not get written to the myapp.app/Contents/MacOS folder and so settings can't be read in.
Is there anyway to get around this? Has anyone encountered this before?
Mitch
osx will likely not allow you writing to your bundle location on installed apps, for security reasons and because it may conflict when multiple users are using your app.
To be cross platform, you could write instead to:
QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
which resolves to
~/Library/Application Support/<APPNAME>
and
C:/Users/<USER>/AppData/Local/<APPNAME>
or equivalent on windows.
You're never supposed to write to the application bundle, whether on Mac or on Windows. Even on Windows, it will not work if your user isn't an administrator. This idea last made sense on Windows 95 - not even on Windows NT. Don't do it.

Web update application with Firemonkey on MacOS

I'm making a Firemonkey application for both Windows and MacOS, and now I'm working on making it able to check online for updates and download the update. I have got it to work on Windows, by renaming the running .exe file, download the new one and then run the downloaded .exe, works as it should.
Now my problem is MacOS, I don't have much experience with MacOS, so I don't really have any idea how I should do this :/
And even less idea as I store somedata files inside the 'program.app' folder.
So I'd really appreciate some help or ideas on how I should try to solve this problem?
Apps on OSX are really just a package of files. If you go into finder on OSX and right click on an app you will see show package contents. Open that up and you will see the constituent files that make up the "app". From there you have to decide what you need to replace.

Application updates in Mac OS X

To provide application updates in Windows, we can simply download the installer and run it. Applications are installed in %PROGRAMFILES% and shortcuts are placed in various places. Keys and values are added to the registry to provide an entry in the system's Programs list.
To provide application updates in Linux, we can use the system's package manager.
How do you provide application updates in Mac OS X? I think in general you simply drag .app bundles to /Applications? Does the system provide any sort of registry other than "look in /Applications folder"? Should the general flow of updating simply involve downloading an opening a DMG file, prompting the user to drag the new application bundle into /Applications? Will copying an app bundle to a folder delete the existing bundle before copying, or does it act like a normal folder (e.g. add and replace existing files)? I'd just like some general information on how I know go about implementing a 'check for updates' feature consistent with what's expected for a Mac OS X application.
It sounds like you should look into Sparkle.
In my experience as a Mac user (not a Cocoa dev), it's become the de facto standard for self-updating apps, save for a few monoliths like Microsoft Office and Adobe CS.

Resources