らくらくアップデートSparkle

896 views

Published on

2009-05-19 Cocoa勉強会関西 #15

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
896
On SlideShare
0
From Embeds
0
Number of Embeds
21
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

らくらくアップデートSparkle

  1. 1. Sparkle in 2009 12 19
  2. 2. 2009 12 19
  3. 3. ‣ ‣ ‣ Appcasting ‣ MIT http://sparkle.andymatuschak.org/ 3 2009 12 19
  4. 4. ‣ ‣ ‣ Appcasting ‣ MIT http://sparkle.andymatuschak.org/ 3 2009 12 19
  5. 5. ‣ RSS 2.0 ✦ Podcasting ✦ enclosure http://connectedflow.com/appcasting/ 4 2009 12 19
  6. 6. <?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle"> <channel> <title>MyNiceApp Appcast</title> <link>http://example.com/appcast.xml</link> <description>MyNiceApp Releases</description> <language>en</language> <item> <title>MyNiceApp Version 1.5.5</title> <description>http://example.com/release155.html</description> <pubDate>Sat, 19 May 2007 15:00:00 +0000</pubDate> <enclosure url="http://example.com/files/myniceapp_1.5.5.dmg" length="371494" type="application/octet-stream"/> </item> </channel> </rss> 5 2009 12 19
  7. 7. 1Passwd CSSEdit iAlertU Max Podcast Maker SubCleaner 1Passwd Cyberduck iAmazon MainMenu Posterino SubEthaEdit Airport Monitor D&D Manager iKey MacFungus Pukka Suitcase Fusion Utility Desk Lamp InCrease MarsEdit Punakea Tables Adium Desktop Lyrics InsomniaX MDict Pyro Task List Alarm Clock Diamond iPalette MemoryMiner QuickEffect TrailRunner Album Art Thingy Diffly iProcrastinate MiniBatteryLogger Quinn Trampoline AppZapper DiskLibrary iRetrospect Monolingual RatRace Tranceiver Auction Hunter dotMac Menu iShowU Morph Age RAX Transmission Aurora Downsize iSleep MultiAlarm RDCMenu TrapperKeeper Avenir DrawIt iStumbler Multisite for iWeb Relaunch TubeSock Backuplist+ DVD Remaster iSyncIt Notae rooSwitch TuneConnect BetterZip Event Maker iTerm On The Job rooVid TypeTrainer4Mac BeerAlchemy Family iTunes Album Opal SaverLab UnicodeChecker Birthdaybook Feeder Playlist Creator Overflow Schoolhouse UnRarX BombSquad Find It! Keep It! iVerbum Paintbrush Scrivener Valet Books FlexTime iTunes Remote Parsley is Secure Remote vCardExplorer Bullfrog Flickr Finder Control Atomically Disk Vienna Cast Life ForgEdit Jumpcut Delicious SenChecker VibeKit CDRevolution Gcal.app Keep It Together Path Finder Senor Staff Virtual Dashboard Checkout Ghost Action Kandalu X PDFClerk Shimo Virtue ChocoFlop Google Buddy License Keeper PDFKey Pro SimplyBurns Voice Candy Cocoalicious GuidaTV Linkinus PDFView SiteCapture Wcode Code Collector guitone LoadMyTracks Peek-a-Boo SNCF Schedules Xacktunes Colloquy hawkeye LogitechLCDTool Peel Snapshot Xcast Compare Folders Hazel LogTen Pro Pixen SolarSeek Xslimmer Corripio HostManager Luscious SMS Planbook Soulver Crittersim Magrathea Play Springy 6 2009 12 19
  8. 8. 1Passwd CSSEdit iAlertU Max Podcast Maker SubCleaner 1Passwd Cyberduck iAmazon MainMenu Posterino SubEthaEdit Airport Monitor D&D Manager iKey MacFungus Pukka Suitcase Fusion Utility Desk Lamp InCrease MarsEdit Punakea Tables Adium Desktop Lyrics InsomniaX MDict Pyro Task List Alarm Clock Diamond iPalette MemoryMiner QuickEffect TrailRunner Album Art Thingy Diffly iProcrastinate MiniBatteryLogger Quinn Trampoline AppZapper DiskLibrary iRetrospect Monolingual RatRace Tranceiver Auction Hunter dotMac Menu iShowU Morph Age RAX Transmission Aurora Downsize iSleep MultiAlarm RDCMenu TrapperKeeper Avenir DrawIt iStumbler Multisite for iWeb Relaunch TubeSock Backuplist+ DVD Remaster iSyncIt Notae rooSwitch TuneConnect 158 apps BetterZip Event Maker iTerm On The Job rooVid TypeTrainer4Mac BeerAlchemy Family iTunes Album Opal SaverLab UnicodeChecker Birthdaybook Feeder Playlist Creator Overflow Schoolhouse UnRarX BombSquad Find It! Keep It! iVerbum Paintbrush Scrivener Valet Books Bullfrog FlexTime Flickr Finder Control(May. 2007) iTunes Remote Parsley is Atomically Secure Remote Disk vCardExplorer Vienna Cast Life ForgEdit Jumpcut Delicious SenChecker VibeKit CDRevolution Gcal.app Keep It Together Path Finder Senor Staff Virtual Dashboard Checkout Ghost Action Kandalu X PDFClerk Shimo Virtue ChocoFlop Google Buddy License Keeper PDFKey Pro SimplyBurns Voice Candy Cocoalicious GuidaTV Linkinus PDFView SiteCapture Wcode Code Collector guitone LoadMyTracks Peek-a-Boo SNCF Schedules Xacktunes Colloquy hawkeye LogitechLCDTool Peel Snapshot Xcast Compare Folders Hazel LogTen Pro Pixen SolarSeek Xslimmer Corripio HostManager Luscious SMS Planbook Soulver Crittersim Magrathea Play Springy 6 2009 12 19
  9. 9. 2009 12 19
  10. 10. ‣ ‣ ✦ ✦ ‣ localized with Cyberduck ✦ .lproj →26 (ver 1.1) 8 2009 12 19
  11. 11. 2009 12 19
  12. 12. 1. URL Appcasting 2. 3. 4. − 5. 10 2009 12 19
  13. 13. ✦ ✦ ✦ Info.plist 11 2009 12 19
  14. 14. 2009 12 19
  15. 15. 2009 12 19
  16. 16. ‣ ‣ ‣ Appcast 14 2009 12 19
  17. 17. CFBundleVersion MyApp_x.y.z.dmg zip, tar, tbz, tgz, dmg 15 2009 12 19
  18. 18. ‣ .app ‣ .pkg .dpkg ‣ .app 16 2009 12 19
  19. 19. <?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle"> <channel> <title>MyNiceApp Appcast</title> <link>http://example.com/appcast.xml</link> <description>MyNiceApp Releases</description> <language>en</language> <item> <title>MyNiceApp Version 1.5.5</title> <description>http://example.com/release155.html</description> <pubDate>Sat, 19 May 2007 15:00:00 +0000</pubDate> <enclosure url="http://example.com/files/myniceapp_1.5.5.dmg" length="371494" type="application/octet-stream"/> </item> </channel> </rss> 17 2009 12 19
  20. 20. <?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle"> <channel> <title>MyNiceApp Appcast</title> Sparkle <link>http://example.com/appcast.xml</link> <description>MyNiceApp Releases</description> <language>en</language> <item> <title>MyNiceApp Version 1.5.5</title> <description>http://example.com/release155.html</description> <pubDate>Sat, 19 May 2007 15:00:00 +0000</pubDate> <enclosure url="http://example.com/files/myniceapp_1.5.5.dmg" length="371494" type="application/octet-stream"/> </item> </channel> </rss> 17 2009 12 19
  21. 21. <?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle"> <channel> <title>MyNiceApp Appcast</title> Sparkle <link>http://example.com/appcast.xml</link> <description>MyNiceApp Releases</description> <language>en</language> <item> <title>MyNiceApp Version 1.5.5</title> <description>http://example.com/release155.html</description> <pubDate>Sat, 19 May 2007 15:00:00 +0000</pubDate> <enclosure url="http://example.com/files/myniceapp_1.5.5.dmg" length="371494" type="application/octet-stream"/> </item> </channel> </rss> URL 17 2009 12 19
  22. 22. 2009 12 19
  23. 23. A.appcast B. i. Sparkle ii. Nib iii.Info.plist 19 2009 12 19
  24. 24. 20 2009 12 19
  25. 25. SUUpdater 21 2009 12 19
  26. 26. SUUpdater checkForUpdate: 22 2009 12 19
  27. 27. SUFeedURL ( ) ( )appcast URL SUCheckAtStartup ( ) SUScheduledCheckInterval ( ) SUShowReleaseNote ( ) UserDafaults 23 2009 12 19
  28. 28. 2009 12 19
  29. 29. ‣ sparkle:releaseNotesLink ‣ URL 25 2009 12 19
  30. 30. ‣ sparkle:md5sum enclosure <enclosure sparkle:md5Sum=”8659fdec0f64edf04ec4fd8756b819eb" url="http://example.org/MyNiceApp_Orange.zip" length="12345" type="application/octet-stream"/> 26 2009 12 19
  31. 31. ‣ Info.plist ‣ SUPublicDSAKey → ‣ SUExpectsDSASignature → YES ‣ enclosure sparkle:dsaSignature 27 2009 12 19
  32. 32. ‣ sparkle:version ‣ <enclosure sparkle:version="1.5.5" url="http://example.org/MyNiceApp_Orange.zip" length="12345" type="application/octet-stream"/> 28 2009 12 19
  33. 33. ‣ ‣ .lproj/InfoPlist.strings SUFeedURLKey URL 29 2009 12 19
  34. 34. ‣ ‣ DSA 30 2009 12 19
  35. 35. 2009 12 19
  36. 36. 1. URL Appcasting 2. 3. 4. − 5. 32 2009 12 19
  37. 37. 1. URL Appcasting 2. 3. 4. − 5. 32 2009 12 19
  38. 38. SUUtilities.[hm] 3 SUStandardVersionComparison() -2 SUSplitVersionString() - SUGetCharType() - / / 33 2009 12 19
  39. 39. “1.23.4a”→{1,”.”,23,”.”,4,”a”} • • 34 2009 12 19
  40. 40. int SUGetCharType(NSString *character) { if ([character isEqualToString:@"."]) { return kPeriodType; } else if ([character isEqualToString:@"0"] || [character intValue] != 0) { return kNumberType; } else { return kStringType; } } 35 2009 12 19
  41. 41. int SUGetCharType(NSString *character) { if ([character isEqualToString:@"."]) { return kPeriodType; } else if ([character isEqualToString:@"0"] || [character intValue] != 0) { return kNumberType; } else { return kStringType; } } 35 2009 12 19
  42. 42. “1.23.4a”→ {1,23,4,”a”} “1.23.5.2”→{1,23,5, 2} • • > • 36 2009 12 19
  43. 43. “1.23.4a”→ {1,23,4,”a”} “1.23.5.2”→{1,23,5, 2} • • > • 36 2009 12 19
  44. 44. “1.23.4a”→ {1,23,4,”a”} “1.23.5.2”→{1,23,5, 2} • • > • 36 2009 12 19
  45. 45. “1.23.4a”→ {1,23,4,”a”} “1.23.5.2”→{1,23,5, 2} • ↑ • > • 36 2009 12 19
  46. 46. “1.23.4a”→ {1,23,4,”a”} “1.23.5.2”→{1,23,5, 2} • ↑ • > • 36 2009 12 19
  47. 47. 1. 2. 3. .app 4. 3. 5. bash 37 2009 12 19
  48. 48. 1. 2. 3. .app 4. 3. 5. bash 37 2009 12 19
  49. 49. 1. 2. 3. .app 4. 3. 5. bash 37 2009 12 19
  50. 50. • NSTemporaryDirectory() + [NSProcessInfo globallyUniqueString] • ”.txt” - (void)[SUUpdater beginDownload] - (IBAction)[SUUpdater installAndRestart:] 38 2009 12 19
  51. 51. • .tar → tar -xC • .tgz → tar -zXC • .zip → ditto -x -k • .tbz → tar -jxC • .dmg → hdiutil ... -(void)[SUUnarchiver extractUpdate] 39 2009 12 19
  52. 52. • .tar → tar -xC • .tgz → tar -zXC • .zip → ditto -x -k • .tbz → tar -jxC • .dmg → hdiutil ... -(void)[SUUnarchiver extractUpdate] 39 2009 12 19
  53. 53. • -[NSFileManager enumeratorAtPath:] • Applications - (IBAction)[SUUpdater installAndRestart:] 40 2009 12 19
  54. 54. • -[NSFileManager movePathWithAuthentication:toPath:] • - (IBAction)[SUUpdater installAndRestart:] 41 2009 12 19
  55. 55. setenv("LAUNCH_PATH", [currentAppPath UTF8String], 1); setenv("TEMP_FOLDER", [[downloadPath stringByDeletingLastPathComponent] UTF8String], 1); system("/bin/bash -c '{ for (( i = 0; i < 3000 && “ ”$(echo $(/bin/ps -xp $PPID|/usr/bin/wc -l))-1; i++ )); don" " /bin/sleep .2;n" " donen" " if [[ $(/bin/ps -xp $PPID|/usr/bin/wc -l) -ne 2 ]]; thenn" " /usr/bin/open "${LAUNCH_PATH}"n" " fin" " rm -rf "${TEMP_FOLDER}"n" "} &>/dev/null &'"); [NSApp terminate:self]; - (IBAction)[SUUpdater installAndRestart:] 42 2009 12 19
  56. 56. setenv("LAUNCH_PATH", [currentAppPath UTF8String], 1); setenv("TEMP_FOLDER", [[downloadPath stringByDeletingLastPathComponent] UTF8String], 1); system("/bin/bash -c '{ for (( i = 0; i < 3000 && “ ”$(echo $(/bin/ps -xp $PPID|/usr/bin/wc -l))-1; i++ )); don" " /bin/sleep .2;n" " donen" " if [[ $(/bin/ps -xp $PPID|/usr/bin/wc -l) -ne 2 ]]; thenn" " /usr/bin/open "${LAUNCH_PATH}"n" " fin" " rm -rf "${TEMP_FOLDER}"n" "} &>/dev/null &'"); [NSApp terminate:self]; bash open - (IBAction)[SUUpdater installAndRestart:] 42 2009 12 19
  57. 57. ‣ Sparkle Appcasting ‣ ‣ ‣ 43 2009 12 19
  58. 58. 2009 12 19
  59. 59. 2009 12 19
  60. 60. ‣ ‣ 46 2009 12 19
  61. 61. ‣ dmg ‣ jp.i.nifty.kimuraw.SparkleSample.plist 47 2009 12 19

×