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

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.

Related

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.

NetBeans Platform (RCP) and "Package as Installers" with serial number

This is my first time using the NetBeans Platform (RCP) for an application. I would like to package the application as .exe installer, and now I know how to do that. What I do not know, is it possible to customize this NetBeans RCP installer to prompt the user for a serial number? Please, any help is greatly appreciated
The only way presently (and that I know of) to do this is to edit the installer's source. The code that is used to create an application's installer is shared between all NBP projects and as such it is probably not a good idea to do this. For reference, the installer code on a Windows 7 machine is located at "C:\Program Files (x86)\NetBeans 7.1\harness\nbi".
Another option for you is to create a "setup" wizard that runs the first time the application runs and gets the serial number then. This is also considered good practice although I have seen applications that ask for a serial number on installation. In general your installer should only be concerned with installing; activating a product should be handled in a setup process.
Edit: The NetBeans Platform has a built in Wizard located in the Dialog API. Of course, The best resource for learning about the NetBeans Platform is the http://platform.netbeans.org site. If you are using 7.1 then this is the tutorial you want.

OS X: Run my application automatically right after installing this .pkg file

I have developed a mac application and using Product->Archive->Share in Xcode to create a .pkg file and will be submitting to Appstore. I would like to run my application automatically right after installing this .pkg file doing this way. I know using PackageMaker, it is possible to write pre and post scripts. But, Appstore is not accepting any .pkg file which are created using PackageMaker, so i'm using Product->Archive->Share in Xcode to create pkg file.
Could someone advise how can i run my application automatically right after installing this .pkg file?
Thank you!
You're not supposed to be able to do this. Part of the point of the App Store is that there's a uniform, consistent installation experience—the app downloads, installs silently, then shows up in LaunchPad for you to run if you want to.
Remember when getting Xcode from the App Store used to mean you got an app called "Install Xcode.app" in /Applications, and then you had to run that installer? That confused half of Xcode's users, who are about as technically savvy a user base as any app is likely to have, and it's from Apple, and even they couldn't get around the problem by auto-launching "Install Xcode.app".

Mac app crashes from finder but runs inside Terminal

I tried searching, but did not find a specific post that could answer my question.
For my MacOS app, I have an external framework residing in /Library/Frameworks that I am linking to.
The app runs fine from Xcode. The app runs fine by itself on my dev system.
If I copy the app bundle over to another machine, and also copy over the external framework to /Library/Frameworks area (so it has a similar setup to my dev machine), the app crashes when it tries to perform the task that uses the external framework.
What's weird is that the app does not crash on the other machine if run from the terminal, or through gdb. It only crashes on the feature using the external framework when launched from the Finder. I made sure permissions etc are all open.
The crash is of BAD_ACCESS (SIGSEGV) type and the feature involves using the framework to write out a file.
Any thoughts about what could be causing the crash/how to go about debugging this?
Thanks
The most likely difference you're running into is working directories -- launching an application manually from the terminal will run it in whatever directory you happen to be in at the time, while launching it normally (e.g, by double-clicking it in the Finder) will start it up with a working directory of /. Make sure you aren't using any relative paths by mistake.

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

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.

Resources