Creating Dropbox like DMG package - macos

Does anyone suggest a freeware tool/script/manual_way of creating Dropbox like DMG -
Need to ask couple of questions --
I want double clicking the Folder-Icon should copy the folder(which would contain installer and uninstaller .app files of my application) into the system's /Applications folder.
Solution -- This has been solved using Applescript and changing icon of that applescript file to the folder-icon(i.e double clicking that script will move our folder(which would be present in a hidden folder) to /Applications.Any suggestions for second and third part?
Is it possible to show hyperlink of actual dropbox.com to actually open it's website?
And how we can customize volume's/Drive icon?

You can find a way to do it by reading this: Packaging a Mac OS X Application Using a DMG » asmaloney.com
I believe you can also use the trick of naming a shellscript file something.command in order to make it double clickable, (but maybe it will open the terminal, -I haven't tried it).

Related

When changing the icon of the Hard Drive in MacOS - where are the icns-file actually stored?

Long story short - I bought a new computer and decided not to do a migration from my old Mac to the new one. Still - there are some things I would like to keep and the icon I found years ago to replace the "Macintosh HD" icon is something I very much would like to find.
So my question is - where are these icons actually stored? I've searched "everywhere". It's not in /System/Library/CoreServices/C­oreTypes.bundle/Contents/Resou­rces where the system icons is stored.
Anyone out there with the same level of OCD as me who can help me out?
I'm running Catalina 10.15.1 if relevant.
First of all:
Custom icons that you use to override System default ones will never be stored inside /System/Library/.. as this is a System reserved folder.
On macOS when you paste a custom icon to a folder or file using the Finder Info panel these are stored in the resource fork of the extended attributes of a file/folder.
Now regarding your use case:
In order to see these you need to show the hidden files and you will see
.VolumeIcon.icns on your / local drive (Macintosh HD):
As this is a write protected path (SIP) you cannot store custom data there and instead this .VolumeIcon.icns alias is there and will point to the actual icon file.
If you are still not able to locate the icon file you can always use this next trick. Open the Finder "Info Panel" for your MacintoshHD that has the custom icon and click on the icon representation and copy it to the clipboard (cmd + C) and then open Preview and select "File > New from Clipboard" and then save the icon as icns. Done!

Setting an icon for a symbolic link

I am trying to finish a product for a client and need to create two aliases on the Desktop and the Dock to make it easy for the end-user to start the two main apps in the product. The installation script finishes off the installation by setting icons to various folders and files. The installation creates a folder under the /Applications folder, and another under the /Users/Shared folder. Each of these folders has an icon applied to them using SetFileIcon (a shareware app). The script then creates two aliases on the desktop and applies an icon to each of these aliases, again using SetFileIcon.
My first problem is that one of the aliases points to an Excel spreadsheet, but this spreadsheet gets replaced each time the update application is run. This leaves the alias pointing to the spreadsheet in the wastebasket and the new file completely unaliased. My updater application is written in Mono - so there is no easy way to call out to the Mac OS to recreate the alias, reset the icon and put it on the desktop and the dock.
I tried to work around this by creating a symbolic alias to the spread sheet using the script command and then applying an icon:
SetFileIcon "/path/to/spreadsheeticonfile" "/path/to/spreadsheet.xls"
ln -s "/path/to/updater" "/Users/$USER/updateralias"
ln -s "/path/to/spreadsheet.xls" "/Users/$USER/spreadsheetalias"
SetFileIcon "/path/to/iconfile" "/Users/$USER/spreadsheetalias"
The first SetFileIcon command works fine, and the Spreadsheet now has a new Icon associated with it. The first "ln -s" also works fine, and a new slias is created with the updater icon associated with it. The second "ln -s" creates an alias to the spreadsheet, but there is a plain white icon, not the icon associated with the spreadsheet. The last SetFileIcon is my desparate attempt to force an icon on the alias - which also does not work.
I have tried creating a bash script that launches the excel spreadsheet, and that seems to accept an icon, but seems to have a similar . But it also leaves a terminal session running, after the excel spreadsheet starts, and the alias to the bash script will also not accept an icon, even when hand-applied.
2 questions:
1. Is there any way to assign an icon to a symbolic alias that works. Even hand setting the icon on the alias using GetInfo does not work.
2. Failing getting an Alias to work, is there any workaround that would allow me at installation time to have a link on the users desktop and their dock which has the nice icon we want to use, rather than a generic excel white square. I just need an easy way to put a link with an icon to a file in another directory on the user's desktop, which will survive that file being updated periodically, and do it at install time. Simple.
Suggestions welcome.
Thanks, Neil
P.S. It probably goes with out saying that I am a MAC newbie - I originally developed this product for the client in the PC World, but he then received repeated requests to translate it for the Mac, and so, here I am struggling to learn development on the Mac.
Symbolic links are not the same as aliases. (And there is no such thing as a "symbolic alias".) You cannot set the icon of a symbolic link, because it is not a normal file, and thus can't have the appropriate properties set on it.
There are a number of ways to create an alias, but one easy one is using AppleScript:
osascript -e 'tell application "Finder" to make new alias at (path to desktop folder) to (("/path/to/file") as POSIX file)'
(NB: The path will need to exist for this to work.)
Once you've done this, you should be able to set the icon on that.

How to make swf file including other resources to a application bundle in osx?

I'm new to Mac OS X, so these questions may seem to be stupid.
I have googled for nearly half a day, but can't find the exact answers.
About applications on Mac OS X:
Does any application must be placed in the /Applications folder to execute it?
If not, how does Mac OS know what applications I have installed and show them all in the Launch Panel?
What should I do to install an "nake" foo.app ?
Is this possible and how to implement it? or any other suggestions?
I downloaded the "Flash Player.app" from Adobe's site, and got a .swf file and some other resource files that will be loaded by the .swf file.
I want to bundle the "Flash Player.app" and the swf file including its resource files together to form an MySwf.app using AppleScript. So that the .swf file can be opened on any other Mac without the "Flash Player.app" having to be installed.
Thanks a lot! :)
My final resolution:
run.app, compiles from an AppleScript whose content is as follow:
set myPath to path to me
tell application "Finder"
set folderPath to container of myPath as string
open (folderPath & "Source:minigame.swf") using (folderPath & "Source:Flash Player.app")
end tell
Source folder which contains Flash Player.app and minigame.swf.
When I zip them and give the zip archive to other guy, he just need to unzip it and double click the run.app before opening the minigame.swf.
At first, I tried to put both Flash Player.app and minigame.swf in the run.app bundle which was unfortunately failed. There may be some 'tricks' I don't know yet...
You need to run the Flash installer to make the Flash Player work. Flash gets disabled every now and then. So, you will have to rely on the user to install and update flash. It doesn't make sense to install Flash Player.app only.
Applications don't need to be installed in /Applications to be executable. You can execute them from anywhere, as long as the file has the necessary permissions.
When an .app package is written to disk, Mac OS X recognises this and updates the desktop files using the bundle identifier that is in the package. THat's how OSX knows which app to use to open a particular file.
Apps don't get added to the launch panel automatically. Their installers have to take care of this. You can add apps to the launch panel manually.

Creating an installer for my Mac application

I have this Mac application that consists of 2 files:
firstFile.tst
secondFile
I would like to put them in:
~/Library/Audio/MyProg/
~/Library/Application Support/MyProg/
I would also like the installer to look like them fancy DMG installers (like Skype's).
Now, I am a newbie when it comes to Mac but I am willing to learn whatever it takes.
I know the dmg installers are actually drags and drops; does that mean that if my application doesn't consist of a real application (it is a plug in - there's no shortcut to put in the Applications folder) then I can't do it?
I was thinking about calling the icon on the left MyProg and the icon on the right COMP_NAME and that dragging MyProg to COMP_NAME simply put the 2 files I described in the places I described for them.
Is there's any way to achieve this or should I just go with PackageMaker and drop the fancy dmg idea (I really like the fancy installers)?
Thanks.
I've seen several plugins like this that use PackageMaker, but wrap the package in a .dmg (that is, you mount the .dmg and all it has on it is a .pkg file).

Creating a dual Mac/Win Autorun CD

How do I create a CD that opens a "Drag this icon to the Application folder to install" on the Mac and autoruns an installer on Windows?
Jordan Brough has a really good write-up on his blog about this:
http://jordan.broughs.net/archives/2008/03/creating-cross-platform-windows-and-mac-installer-cds
For what it's worth, this was the first result returned from a fairly simple google search...
You can use hdiutil
eg.
hdiutil makehybrid -o [output-file] [input-folder] -iso -hfs -hide-iso [mac-only-file] -hide-hfs [windows-only-files]
What you will want to do is hide the windows specific files from the HFS partition and hide the Mac only files from the ISO.
Then you would use an autorun file as your normally would on Windows.
On the Mac side there are many applications you can buy for creating a Finder window that looks a certain way but all these changes can be made within finder. You then will need to copy the DS_Store file to the CD and finder will automatically apply any changes that you have made.
Also using -hfs-openfolder will cause it to open automatically when inserted on the mac.

Resources