Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Okay, I've made a sample disk image for you to use.

You can hide all your files inside an invisible folder called 'files' (press shift-command-g and type "files" then ok). Download it, put your things into it and test it out there. When you're done, open the dmg in Disk Utility, right click on the image, then go to convert, change the image format to read-only to test it all works, then burn it.

To clarify, you cannot launch items in Mac Os X from the browser (unless you have a plugin for it (like how .zip/.pdf etc open on their own).

Yeah, using someone else's cobbled together code isn't the best of things, so I tried to make it as easy as possible. Only change the bits at the top.

Finally, it asks for the admin password everytime because I don't know how to check if the user is logged in as admin...wait I have an idea.
 

Attachments

  • blahblah.dmg.zip
    95 KB · Views: 86
Okay, I've made a sample disk image for you to use.

You can hide all your files inside an invisible folder called 'files' (press shift-command-g and type "files" then ok). Download it, put your things into it and test it out there. When you're done, open the dmg in Disk Utility, right click on the image, then go to convert, change the image format to read-only to test it all works, then burn it.
thats very nice of you :) thankyou! i can see hidden files already so no need for the shift command g thing lol.

To clarify, you cannot launch items in Mac Os X from the browser (unless you have a plugin for it (like how .zip/.pdf etc open on their own).
bugger. darn security!

Yeah, using someone else's cobbled together code isn't the best of things, so I tried to make it as easy as possible. Only change the bits at the top.
its very easy! always takes quite a while to get used to though as ive never used scripting before, i think i have the hang of it now.

Finally, it asks for the admin password everytime because I don't know how to check if the user is logged in as admin...wait I have an idea.
another idea?!? haha!

yea i just think that some people might think that its a security issue, you know what they are like. :rolleyes:
 
Like I mentioned in my first post here, people should be suspicious. You can make a simple applescript app with a single line asking for admin that destroys all their data, and it wouldn't look any different to ours.

Well, this is it. I hope.

Code:
set path_to_dmg to "/cliclick.dmg" -- need trailing slash
set name_of_mounted_dmg to "cliclick"
set path_to_app to "" -- blank if the app is at the root of the dmg
set name_of_application to "cliclick"

-- check for admin privs
try
	do shell script "touch /Applications"
	set have_admin to true
on error
	set have_admin to false
end try

set mount_dmg to "hdiutil attach '" & path_to_dmg & "'"
do shell script mount_dmg
try
	set copy_app_admin to "cp -R '/Volumes/" & name_of_mounted_dmg & path_to_app & "/" & name_of_application & "'" & " /Applications/"
	if have_admin is equal to true then
		do shell script copy_app_admin
	else
		do shell script copy_app_admin with administrator privileges
	end if
on error
	try
		set dialogresult to display dialog ¬
			"Admin privileges were not verified. Proceed to copy to desktop?" buttons {"Cancel", "OK"} ¬
			default button "OK" cancel button "Cancel"
	on error number -128
		do shell script "hdiutil detach /Volumes/" & name_of_mounted_dmg
		return
	end try
	if button returned of dialogresult is "OK" then
		set copy_app to "cp -R '/Volumes/" & name_of_mounted_dmg & path_to_app & "/" & name_of_application & "'" & " ~/Desktop/"
		do shell script copy_app
	end if
end try
do shell script "hdiutil detach /Volumes/" & name_of_mounted_dmg
if have_admin is equal to false then
	do shell script "open -R ~/Desktop/" & name_of_application
else
	do shell script "open -R /Applications/" & name_of_application
end if

Btw, you asked me what I do like a thousand posts ago...I'm at usyd, doing engineering and comp sci. Not doing great, but doing it.
 
Like I mentioned in my first post here, people should be suspicious. You can make a simple applescript app with a single line asking for admin that destroys all their data, and it wouldn't look any different to ours.
its quite scary! that its so easy.. so they have every right to think like that, not that many do though.


Well, this is it. I hope.
that looks very complicated and i thank you eternally for your help.. thank you again


Btw, you asked me what I do like a thousand posts ago...I'm at usyd, doing engineering and comp sci. Not doing great, but doing it.
ahh nice! im at griffith on the goldy doing bach of IT maj in Networking & security. im getting thru only got one year left i just wanna get out there and work to earn money. i hate being poor!
 
that looks very complicated and i thank you eternally for your help.. thank you again

No probs, anytime.

ahh nice! im at griffith on the goldy doing bach of IT maj in Networking & security. im getting thru only got one year left i just wanna get out there and work to earn money. i hate being poor!

Yeah, uni kinda sucks you dry in more ways than one! I've got a couple years to go, the comp sci is pretty easy, the eng is slaughter in comparison.

Before I forget, been meaning to ask, you applied for a job at a Apple Store right? I think you've explained this story a bunch of times already on this forum, why didn't they give it to you?
 
No probs, anytime.
:D:D

Yeah, uni kinda sucks you dry in more ways than one! I've got a couple years to go, the comp sci is pretty easy, the eng is slaughter in comparison.
oh yea i have a few mates that do engineering and they are just full on all the time, my degree is pretty full on too i guess. it might be that im just naturally dumb tho lol

Before I forget, been meaning to ask, you applied for a job at a Apple Store right? I think you've explained this story a bunch of times already on this forum, why didn't they give it to you?
i did apply, you have a good memory! i didnt really get any feedback, but the impression i got was that my personality wasnt good enough for them. i guess they can judge that by a 1hr seminar with 10 other people.

apparently apple do not like hiring technologically sound people. i dont mean to sound rude or arrogant, but the other people in there didn't know squat. sure they were nice and were good in say photoshop or something similar, but i am an all-round type of person - i know all apple hardware off the back of my hand, i can navigate all the apple iLife software/FCP etc software with ease, and i can troubleshoot pretty darn well because of the knowledge that i have. i guess i should have said that in the interview right haha

im pretty angry about it all tbh.
 
there is trouble when unmounting the disk image
Code:
do shell script "hdiutil detach /Volumes/ & name_of_mounted_dmg"

"sh: name_of_mounted_dmg: command not found
hdiutil: detach failed - No such file or directory"


its having trouble finding the disk image because of the code. i tried to fix it using the '" & "' method but that didnt seem to work :(

hmm ok the error is because the Adium disk image name is "Adium X 1.3.1", i dont think the script allows for spaces and stuff.. maybe..not sure.
 
oh yea i have a few mates that do engineering and they are just full on all the time, my degree is pretty full on too i guess. it might be that im just naturally dumb tho lol

I know is that if you're finding it easy then you're not doing enough.

i did apply, you have a good memory! i didnt really get any feedback, but the impression i got was that my personality wasnt good enough for them. i guess they can judge that by a 1hr seminar with 10 other people.

apparently apple do not like hiring technologically sound people. i dont mean to sound rude or arrogant, but the other people in there didn't know squat. sure they were nice and were good in say photoshop or something similar, but i am an all-round type of person - i know all apple hardware off the back of my hand, i can navigate all the apple iLife software/FCP etc software with ease, and i can troubleshoot pretty darn well because of the knowledge that i have. i guess i should have said that in the interview right haha

im pretty angry about it all tbh.

Well, my parents wouldn't mind me finding a job for myself for experience and all that (and I wouldn't mind having keeping the money from that job to get me some nice toys).

So you had to turn up to a seminar (is it a shortlist?) and they do a meet and greet with all of you guys/gals and that from there is it interview or is that it? I suppose they are looking for the outgoing type, retail helpful type. I wonder where I'd stand in all that. Guess you wouldn't know until you try.

Guess I'll have to play the 'passion' card, but not so much the nerd card.
 
Ah, okay that's easily fixed

Code:
do shell script "hdiutil detach '/Volumes/" & name_of_mounted_dmg & "'"
The single inverted commas go around the path and those "&" combine strings together, so we stick the single comma before /Volumes/ and after the variable name_of_mounted_dmg by adding the single inverted commas via the &.

The 'do shell script' function takes a single string. Any variables you have inside the string (namely name_of_mounted_dmg) will be taken literally (not replaced with say 'Handbrake').

Code:
set path_to_dmg to "/cliclick.dmg" -- need trailing slash
set name_of_mounted_dmg to "cliclick"
set path_to_app to "" -- blank if the app is at the root of the dmg
set name_of_application to "cliclick"

-- check for admin privs
try
	do shell script "touch /Applications"
	set have_admin to true
on error
	set have_admin to false
end try

set mount_dmg to "hdiutil attach '" & path_to_dmg & "'"
do shell script mount_dmg
try
	set copy_app_admin to "cp -R '/Volumes/" & name_of_mounted_dmg & path_to_app & "/" & name_of_application & "'" & " /Applications/"
	if have_admin is equal to true then
		do shell script copy_app_admin
	else
		do shell script copy_app_admin with administrator privileges
	end if
on error
	try
		set dialogresult to display dialog ¬
			"Admin privileges were not verified. Proceed to copy to desktop?" buttons {"Cancel", "OK"} ¬
			default button "OK" cancel button "Cancel"
	on error number -128
		do shell script "hdiutil detach '/Volumes/" & name_of_mounted_dmg & "'"
		return
	end try
	if button returned of dialogresult is "OK" then
		set copy_app to "cp -R '/Volumes/" & name_of_mounted_dmg & path_to_app & "/" & name_of_application & "'" & " ~/Desktop/"
		do shell script copy_app
	end if
end try
do shell script "hdiutil detach '/Volumes/" & name_of_mounted_dmg & "'"
if have_admin is equal to false then
	do shell script "open -R ~/Desktop/" & name_of_application
else
	do shell script "open -R /Applications/" & name_of_application
end if
 
I know is that if you're finding it easy then you're not doing enough.
too true!



Well, my parents wouldn't mind me finding a job for myself for experience and all that (and I wouldn't mind having keeping the money from that job to get me some nice toys).
this is why im doing this project right now! its to go with the computer when i sell it, a complementary DVD of software for them to use.

So you had to turn up to a seminar (is it a shortlist?) and they do a meet and greet with all of you guys/gals and that from there is it interview or is that it? I suppose they are looking for the outgoing type, retail helpful type. I wonder where I'd stand in all that. Guess you wouldn't know until you try.
no lol it wasnt that simple.

1. create your resume, register with apple, put in details, upload resume to apple.
2. search for the available job on the apple store (it just so happened they were opening an apple store near me).
3. apply for job
4. if they like your resume, they invite you to the seminar thing. you introduce yourself, watch a video and perform in groups doing tasks etcetc
5. you go home, if they like you they contact you. if you are unsuccessful then you never hear from them again

Guess I'll have to play the 'passion' card, but not so much the nerd card.
yes do that. they need to see that you can talk without being embarrased and are passionate.. thats all they care about.

thanks for the fix ill try it soon :D

EDIT: just tried it, and it now works! :D success!!!! (copying to the desktop that is, i have faith that it copies to the apps folder)
 
this is why im doing this project right now! its to go with the computer when i sell it, a complementary DVD of software for them to use.
I thought you were gonna give this away to people with that little company or website you were making?
no lol it wasnt that simple.

1. create your resume, register with apple, put in details, upload resume to apple.
2. search for the available job on the apple store (it just so happened they were opening an apple store near me).
3. apply for job
4. if they like your resume, they invite you to the seminar thing. you introduce yourself, watch a video and perform in groups doing tasks etcetc
5. you go home, if they like you they contact you. if you are unsuccessful then you never hear from them again

Lol. What positions did you apply for? I do casual waitering a couple months out of every year for my parents, so I'm hoping that will get me at least to the seminar. What are these tasks? Role-playing? Trust? lol

yes do that. they need to see that you can talk without being embarrased and are passionate.. thats all they care about.

thanks for the fix ill try it soon :D

Gotcha, thanks for that. Lemme know how that goes.
 
I thought you were gonna give this away to people with that little company or website you were making?
yup thats it. the company has now expanded to making/selling/building computers :D but ill also have them for people if they dont want the computer. its still all in the planning stage though at the moment. very time consuming! i have the website up and running.


Lol. What positions did you apply for? I do casual waitering a couple months out of every year for my parents, so I'm hoping that will get me at least to the seminar. What are these tasks? Role-playing? Trust? lol
i cant remember the exact names. but it was basically the sales people, and the genius bar people. ur work experience doesnt really matter tbh, they just care about presentation/enthusiasm.

tasks such as we were given a chair and told to market it. no role playing or stuff like that.

Gotcha, thanks for that. Lemme know how that goes.

i edited my last post, it works GREAT :D thankyou!
 
Thanks very much for the info. And if it goes my way I'll be sure to let you know.

thats ok tit for tat. if you ever need help with anything hardware/networking related then just give me a yell :D:D:D

ill probably be back in 30 asking for more help haha!

thanks once again
 
a couple of applications that i have are installers inside the dmg (such as iTunes). i know what to do, modify the program to mount the image, open the installer, let the user do the installation, then unmount when the installer app quits. seems easy enough in theory. it seems to now be working. how does this code look?

Code:
set path_to_dmg to "/Volumes/GLITCHES DVD/.files/Softwares/Mac/iTunes_9.0.1.dmg/" -- need trailing slash
set name_of_mounted_dmg to "iTunes 9.0.1"
set path_to_app to "" -- blank if the app is at the root of the dmg
set name_of_application to "iTunes.mpkg"

set mount_dmg to "hdiutil attach '" & path_to_dmg & "'"
do shell script mount_dmg

do shell script "open '/Volumes/iTunes 9.0.1/iTunes.mpkg' "

do shell script "hdiutil detach '/Volumes/" & name_of_mounted_dmg & "'"
 
a couple of applications that i have are installers inside the dmg (such as iTunes). i know what to do, modify the program to mount the image, open the installer, let the user do the installation, then unmount when the installer app quits. seems easy enough in theory. it seems to now be working. how does this code look?

Code:
set path_to_dmg to "/Volumes/GLITCHES DVD/.files/Softwares/Mac/iTunes_9.0.1.dmg/" -- need trailing slash
set name_of_mounted_dmg to "iTunes 9.0.1"
set path_to_app to "" -- blank if the app is at the root of the dmg
set name_of_application to "iTunes.mpkg"

set mount_dmg to "hdiutil attach '" & path_to_dmg & "'"
do shell script mount_dmg

do shell script "open '/Volumes/iTunes 9.0.1/iTunes.mpkg' "

do shell script "hdiutil detach '/Volumes/" & name_of_mounted_dmg & "'"

Oops, I guess I didn't check back (and subscriptions are so useless when you have so many of them).

I'm sure you would've figured this out with some trial and error by now lol Be sure to PM me next time :)

(the last line won't work, so you'll need either just give the user a message, or just let it be because it's a pkg, user's won't be as confused with an app that launches from the dmg itself).
 
Oops, I guess I didn't check back (and subscriptions are so useless when you have so many of them).

I'm sure you would've figured this out with some trial and error by now lol Be sure to PM me next time :)

(the last line won't work, so you'll need either just give the user a message, or just let it be because it's a pkg, user's won't be as confused with an app that launches from the dmg itself).

haha yea i did eventually find a fix for it all lol and its all going sweet as. ive designed the cover for the DVD just now trying to figure out how the hell to get the disc compatible with both Mac & PCs. bloody annoying!! haha.

thanks again anyway :)
 
haha yea i did eventually find a fix for it all lol and its all going sweet as. ive designed the cover for the DVD just now trying to figure out how the hell to get the disc compatible with both Mac & PCs. bloody annoying!! haha.

thanks again anyway :)

Cool, great to hear.

What do you mean by making it compatible with both? The .bat (or did they get rid of that with vista/7?) script will take care of the Windows side and the folder image will work on OS X. Hope you're testing it with a VM and disk utility :)
 
Cool, great to hear.

What do you mean by making it compatible with both? The .bat (or did they get rid of that with vista/7?) script will take care of the Windows side and the folder image will work on OS X. Hope you're testing it with a VM and disk utility :)

by both i mean have a certain thing happen in an osx computer, and a certain thing open in a windows computer.

for osx: no auto-load things are allowed, so i just want the DVD window to open, i have a background with the GetStarted.html file in the middle. that then does the rest.

for windows: i have a AUTORUN.inf file, but it doesnt seem to be loading the .html file.

my code is
Code:
[autorun]
open=command /c start /max GetStarted.html
label=GLITCHES

so yea idk just needs more trial and errors.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.