Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - cURL Installer I am Creating
cURL Installer I am Creating
 
   NeoOffice Forum Index -> NeoOffice Development
View previous topic :: View next topic  
Author Message
rab777hp
Pure-blooded Human


Joined: Jul 23, 2008
Posts: 37

PostPosted: Fri Aug 15, 2008 8:55 am    Post subject:

Ok- as soon as I do that I'll email it.
Back to top
rab777hp
Pure-blooded Human


Joined: Jul 23, 2008
Posts: 37

PostPosted: Fri Aug 15, 2008 9:11 am    Post subject:

I just emailed it to: donationsupport at neooffice dot org

Edit by pluby: Removed mailto link as we already get more than enough spam Wink
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Fri Aug 15, 2008 9:22 am    Post subject:

Thanks for sending it. We will take a look at it. Note that it may take a bit of time as we are trying to get Patch 4 and now NeoOffice 2.2.5 out the door in the next few weeks but we will look at it in our spare moments.

Patrick
Back to top
rab777hp
Pure-blooded Human


Joined: Jul 23, 2008
Posts: 37

PostPosted: Fri Aug 15, 2008 9:23 am    Post subject:

Sure, I'm looking forward to the update.
Back to top
rab777hp
Pure-blooded Human


Joined: Jul 23, 2008
Posts: 37

PostPosted: Sat Oct 04, 2008 5:40 pm    Post subject:

Hi-
Just wondering if you guys had gotten around to looking at the installer- I know your busy with updates, but I was just wondering.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sat Oct 04, 2008 5:45 pm    Post subject:

rab777hp wrote:
Hi-
Just wondering if you guys had gotten around to looking at the installer- I know your busy with updates, but I was just wondering.


I have only taken a cursory look at it as I have been swamped getting NeoOffice 2.2.5 released and NeoOffice 3.0 Early Access ready for release in November. Sad

Maybe Ed can tell us if he has any time to take a look at it?

Patrick
Back to top
OPENSTEP
The One
The One


Joined: May 25, 2003
Posts: 4752
Location: Santa Barbara, CA

PostPosted: Mon Oct 06, 2008 10:00 pm    Post subject:

Oh, my bad! I totally missed it! I have my mail filters configured in such a way that it routed it into the wrong box in my Mail client...many apologies!!

I think the approach looks great...if run a second time after a reboot or the like curl will see the download has completed and will just reopen the completed disk image.

Here's some initial feedback:


  • In the shell script phase we'll need to add in a "uname -p" check to branch out to PowerPC versus Intel download URLs. I can give a sample of this for you if you'd prefer...I've done it in makefiles quite a bit Smile
  • Although it seems that it's using only standard actions, when I try to launch the prepackaged on 10.4 it crashes, or when open the application in Automator it complains that it was saved with a newer version and is missing resources (although all the three items seem fine to me). Any chance we could recreate the prepackaged on a 10.4 system? Then we could deploy to 10.4 and 10.5 without problems Smile
  • Is it best to save to the Desktop? I don't know if it's possible to actually redirect to the Downloads folder...I think that wasn't standard behaviour until 10.5. Is that true? If so, then Desktop it is! Desktop is better than /tmp since the temp directories would get cleaned out across reboots, which is probably not what you want.
  • Dunno if this is "helpful" or "annoying"...perhaps install the app as a login item? E.g. install it as the first step, then remove it as a login item after the curl. That way if the machine is shut down or restarted the download would recommence on next login. That might be overkill. I'm just wondering as to how to trap potential error codes and then display a warning to the user they need to relaunch to re-start the download. I very well may be missing a step in the workflow, however.


All of the above said, I think it's definitely a great help for users who are afraid of the terminal for entering the curl command and mounting the resulting disk image similar to how Safari will do it. I think I may just be expanding too much in my thoughts on the above Smile

Is the feedback helpful? Too picky? Expanding the concept too much?

ed
Back to top
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Tue Oct 07, 2008 8:54 am    Post subject:

OPENSTEP wrote:
[*]Is it best to save to the Desktop? I don't know if it's possible to actually redirect to the Downloads folder...I think that wasn't standard behaviour until 10.5. Is that true? If so, then Desktop it is! Desktop is better than /tmp since the temp directories would get cleaned out across reboots, which is probably not what you want.

The OS has had a downloads folder, well, since the advent of InternetConfig. It just didn't have a "standard" one until 10.5 (and if you change what is set as the downloads folder in 10.5, well-behaved applications still use your folder instead of hard-coding to ~/Downloads).

I can't remember if AppleScript on 10.4 includes "path to downloads folder" or if that's only on 10.5, but if so you could use AppleScript to query the downloads folder (and then convert that to a quoted form POSIX path).

Among LaunchServices's many failings is the fact that it lacks a command-line tool to meaningfully read or manipulate the LS database and Internet Config settings.... Sad I'm not sure if you can reliably get a human-readable home page out of reading the InternetConfig prefs themselves.

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
rab777hp
Pure-blooded Human


Joined: Jul 23, 2008
Posts: 37

PostPosted: Tue Oct 07, 2008 3:23 pm    Post subject:

Thanks for the feedback-

Sorry- but I have virtually no experience with 'uname -p', however I am a quick learner, so if you show me some samples I should catch on fairly quickly (hopefully Wink )

I can recreate the workflow with an older version of Automator- that is no problem.

About the desktop, if you look at the cURL script that you provide on the site- it automatically is set to save to the Desktop. I never thought to change it because I viewed it as as easier- especially to the masses who may not have the Downloads folder easily accessible, etc., but the Desktop is right there and kind of hard to miss.

I think it would be a bad idea to install this as a login item- generally in the case of a reboot or shutdown the user should know to open the installer again- otherwise they don't want to download NeoOffice that badly Wink

These are my thoughts on what you said, so if you tell me what you think- then I can get started right away!
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Oct 07, 2008 3:34 pm    Post subject:

rab777hp wrote:
Sorry- but I have virtually no experience with 'uname -p', however I am a quick learner, so if you show me some samples I should catch on fairly quickly (hopefully Wink )


Like the command on the website, "uname" is a Terminal command. So, when you execute "uname -p" in a Terminal, it will output either "i386" or "powerpc". If you get "i386", download the .dmg file with "Intel" in the name. If you get "powerpc", download the .dmg file with "PowerPC" in the name.

Hope that helps.

rab777hp wrote:
About the desktop, if you look at the cURL script that you provide on the site- it automatically is set to save to the Desktop. I never thought to change it because I viewed it as as easier- especially to the masses who may not have the Downloads folder easily accessible, etc., but the Desktop is right there and kind of hard to miss.

I think it would be a bad idea to install this as a login item- generally in the case of a reboot or shutdown the user should know to open the installer again- otherwise they don't want to download NeoOffice that badly Wink


I agree with both of your statements.

Patrick
Back to top
rab777hp
Pure-blooded Human


Joined: Jul 23, 2008
Posts: 37

PostPosted: Tue Oct 07, 2008 3:38 pm    Post subject:

So for uname -p we should like an IF THEN so- if its intel then it does the intel one, if it's ppc then we tell it to download the ppc version.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Oct 07, 2008 3:50 pm    Post subject:

rab777hp wrote:
So for uname -p we should like an IF THEN so- if its intel then it does the intel one, if it's ppc then we tell it to download the ppc version.


Exactly.

Patrick
Back to top
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Tue Oct 07, 2008 3:57 pm    Post subject:

sardisson wrote:
The OS has had a downloads folder, well, since the advent of InternetConfig. It just didn't have a "standard" one until 10.5 (and if you change what is set as the downloads folder in 10.5, well-behaved applications still use your folder instead of hard-coding to ~/Downloads).

I can't remember if AppleScript on 10.4 includes "path to downloads folder" or if that's only on 10.5, but if so you could use AppleScript to query the downloads folder (and then convert that to a quoted form POSIX path).

Haha Razz

On 10.5, that just returns the path to the Downloads folder (that is, ~/Downloads, the one everyone can find by guessing) rather than the default downloads folder specified by the OS Razz So much for well-behaved Razz

Beyond that, your point about the Desktop being unmissable is reasonable, though I'd make sure that you indicate somewhere (in the documentation, or in a dialogue in the app, or even just in the filename ["Download NeoOffice to the Desktop" or something]) that the download will end up on the Desktop, since otherwise I'd really expect any app to download to my downloads folder and it would be hard for me to find something on my Desktop that I wasn't expecting there Wink

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
OPENSTEP
The One
The One


Joined: May 25, 2003
Posts: 4752
Location: Santa Barbara, CA

PostPosted: Wed Oct 08, 2008 11:15 pm    Post subject:

Yeah I hear the thoughts on both just going to the Desktop and against doing the login item...sounds fine to me Smile

I notice you're using the bash shell in the Run Shell Script action. Here's a guide on if statements in bash.

To use the uname stuff, add a line to the top of the shell script section like this:

Code:

if [ "`/usr/bin/uname -p`" == "powerpc" ]; then THEURL="http://www.neooffice.org/neojava/en/mirrors.php?file=NeoOffice-2.2.4-PowerPC.dmg&curl=NeoOffice-2.2.4-PowerPC.dmg"; else THEURL="http://www.neooffice.org/neojava/en/mirrors.php?file=NeoOffice-2.2.4-Intel.dmg&curl=NeoOffice-2.2.4-Intel.dmg"; fi


That's all one line Smile That sets the shell variable THEURL to point to either the PowerPC or the Intel image as appropriate.

Next we'll add another line and variable to set the name of the output image:

Code:

if [ "`/usr/bin/uname -p`" == "powerpc" ]; then THEDMG="NeoOffice-2.2.4-PowerPC.dmg"; else THEDMG="NeoOffice-2.2.4-Intel.dmg"; fi


Now change the curl to proceed off of those but without generating any text output. This will be important in the last step:

Code:

cd ~/Desktop ; /usr/bin/curl -L -f -b ~/.neoffice.org.cookies.txt -c ~/.neooffice.org.cookies.txt -C - -o "$THEDMG" "$THEURL" &> /dev/null


Again, all one line.

Now, we add a new final line to the Run Shell Script phase to dump out the path to the downloaded image:

Code:

echo -n "~/Desktop/$THEDMG"


That final step is important...notice that now the option being downloaded is potentially two different names...it's not fixed, so this means we have to change step 2 of the workflow. We can't use Get Specified Finder Items in a 10.4 compatible workflow...Automator variables don't exist until 10.5 Sad Since we no longer can assume a fixed name for the downloaded file we can't use Get Specified Finder Items to locate the disk image.

So...we added the "echo" to the Run Shell Script phase so its outlet will be the path to the file so we can feed it into the next action. Unfortunately, there are no built-in conversions that will take Text and convert it into a File/Folder type for further Finder Automator actions. We need to do this conversion manually.

Replace step 2 with a "Run AppleScript" action. We'll write an AppleScript snippet to do our conversion from a path to a file object. Here's the code:

Code:

on run {input, parameters}
    set T to (input as text)
    set theAlias to (POSIX file T)
    return {(theAlias as alias)}
end run


For the curious, what this is doing is changing the single line path into a single element list of aliases that is returned on the outlet. This is the type corresponding to "Files/Folders" and can be used with any action taking that type as an inlet.

There might be a typo here and there in the above, but I think that should be enough to get things working.

ed
Back to top
rab777hp
Pure-blooded Human


Joined: Jul 23, 2008
Posts: 37

PostPosted: Thu Oct 09, 2008 9:32 am    Post subject:

Just a question:

Why do we need to do all this extra stuff at the end for mounting the dmg? The automator action finds all dmg files on the Desktop and mounts them.
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Development All times are GMT - 7 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.