Creating a dual Mac/Win Autorun CD - windows

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.

Related

Creating Dropbox like DMG package

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).

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.

Creating and Moving an Invisible file with OS X 10.8 Terminal

I'm fairly new to using the terminal, but have so far figured out through various forums how to hide a file from the Finder, but once hidden, I'm obviously unable to move it to the flash drive I want to keep it on, and I can't figure out any way hide the file after it's moved off of the internal drive. I'm using the command line:
Computer-name:~ User$ chflags hidden /users/me/desktop/filename.txt
How do I move the file once it's hidden, or how would I alter the command to hide the file after it's been moved to the flash drive?
Definitely this is an AskDifferent ( https://apple.stackexchange.com/ ) kind of question but at the same time, it's pretty straightforward to answer.
1) simply move the file to your flash drive
and then
2) hide it after it's copied /moved to the flash drive using "chflags hidden" and the path to where it lives on the flash drive. Another option is to use "SetFile -aV path/to/file.txt"
And just because it's hidden from the Finder doesn't mean you can't see it when you type in "ls" in Terminal. So you can reverse the steps and copy after you make the file invisible.

How Can I Change the Icon for an Existing Shortcut in shell script

I have installed my flash application using packagemaker installer. I have created short cut to desktop using shell Script. Now i want to change the default short cut Icon. Please tell me shell script to change the short cut icon.
MAC OS 10.7.2
Mac OS X doesn't have "shortcut files". It has either alias files or symbolic links (symlinks).
I imagine that you created a symlink, since you're working from a shell. Symlinks can't have custom icons. They have almost no real data or metadata of their own.
I don't know of a way to set an icon for an alias file (or any other file) from the shell. My first thought was AppleScript, which you can use from a shell via the osascript command. But I find that the Finder's AppleScript support does not include working with file icons. There's a definition of an icon family class, but it's marked as "NOT AVAILABLE YET".

How to make application autorun on Mac?

I want to make my application autorun, like using autorun.inf on Windows. I googled and there is one way for me to do that:
"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."
Can anyone tell me more clearly about that, or is there any other way?
Thanks so much.
According to this page, you should be able to do that with bless:
sudo bless --folder "/Volumes/discName" --openfolder "/Volumes/discName"
The man page confirms that, at least on 10.6.8. I don't have Lion in front of me right now.

Resources