Skip to content

Commit

Permalink
Updater|Mac OS X: Open the .mpkg after downloading an update
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Feb 16, 2013
1 parent 7396581 commit 7b5d652
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions doomsday/client/src/updater/updater.cpp
Expand Up @@ -372,8 +372,6 @@ struct Updater::Instance
#endif
}

de::String appPath = execPath.fileNamePath();
de::String appName = "Doomsday Engine.app";
de::String volName = "Doomsday Engine " + latestVersion.base();

QString scriptPath = QDir(QDesktopServices::storageLocation(QDesktopServices::TempLocation))
Expand All @@ -383,24 +381,13 @@ struct Updater::Instance
{
QTextStream out(&file);
out << "tell application \"Finder\"\n"
<< " set oldAppFile to POSIX file \"" << execPath << "\"\n"
<< " set dmgFile to POSIX file \"" << distribPackagePath << "\"\n"
<< " set destFolder to POSIX file \"" << appPath << "\"\n"
<< " open document file dmgFile\n"
<< " open document POSIX file \"" << distribPackagePath << "\"\n"
<< " -- Wait for it to get mounted\n"
<< " repeat until name of every disk contains \"" << volName << "\"\n"
<< " delay 1\n"
<< " end repeat\n"
<< " -- Move the old app to the trash\n"
<< " try\n"
<< " delete oldAppFile\n"
<< " end try\n"
<< " -- Copy the new one\n"
<< " duplicate \"" << volName << ":" << appName << "\" to folder (destFolder as string)\n"
<< " -- Eject the disk\n"
<< " eject \"" << volName << "\"\n"
<< " -- Open the new app\n"
<< " open (destFolder as string) & \":" << appName << "\"\n"
<< " -- Start the installer\n"
<< " open document file \"" << volName << ":Doomsday Installer.mpkg\"\n"
<< "end tell\n";
file.close();
}
Expand Down

0 comments on commit 7b5d652

Please sign in to comment.