2 * Copyright 2015, Axel Dörfler <axeld@pinc-software.de>
3 * Copyright 2009, Stephan Aßmus <superstippi@gmx.de>
4 * Copyright 2005, Jérôme DUVAL.
5 * All rights reserved. Distributed under the terms of the MIT License.
8 #include "InstallerApp.h"
18 #include "tracker_private.h"
22 static const uint32 kMsgAgree
= 'agre';
23 static const uint32 kMsgNext
= 'next';
25 //static const char* kEULAText =
26 //"NOTICE: READ THIS BEFORE INSTALLING OR USING HAIKU\n\n"
28 //"Copyright " B_UTF8_COPYRIGHT " 2001-2009 The Haiku Project. All rights "
29 //"reserved. The copyright to the Haiku code is property of Haiku, Inc. or of "
30 //"the respective authors where expressly noted in the source.\n\n"
32 //"Permission is hereby granted, free of charge, to any person obtaining a "
33 //"copy of this software and associated documentation files (the \"Software\"), "
34 //"to deal in the Software without restriction, including without limitation "
35 //"the rights to use, copy, modify, merge, publish, distribute, sublicense, "
36 //"and/or sell copies of the Software, and to permit persons to whom the "
37 //"Software is furnished to do so, subject to the following conditions:\n\n"
38 //"The above copyright notice and this permission notice shall be included in "
39 //"all copies or substantial portions of the Software.\n\n"
41 //"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS "
42 //"OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, "
43 //"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE "
44 //"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER "
45 //"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING "
46 //"FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS "
50 #undef B_TRANSLATION_CONTEXT
51 #define B_TRANSLATION_CONTEXT "InstallerApp"
54 int main(int, char **)
62 InstallerApp::InstallerApp()
64 BApplication("application/x-vnd.Haiku-Installer")
70 InstallerApp::MessageReceived(BMessage
* message
)
72 switch (message
->what
) {
77 new InstallerWindow();
81 BApplication::MessageReceived(message
);
87 InstallerApp::AboutRequested()
89 BAlert
*alert
= new BAlert("about", B_TRANSLATE("Installer\n"
90 "\twritten by Jérôme Duval and Stephan Aßmus\n"
91 "\tCopyright 2005-2010, Haiku.\n\n"), B_TRANSLATE("OK"));
92 alert
->SetFlags(alert
->Flags() | B_CLOSE_ON_ESCAPE
);
93 BTextView
*view
= alert
->TextView();
96 view
->SetStylable(true);
100 font
.SetFace(B_BOLD_FACE
);
101 view
->SetFontAndColor(0, 9, &font
);
108 InstallerApp::ReadyToRun()
111 // Show the EULA first.
112 fEULAWindow
= new EULAWindow();
114 // Show the installer window without EULA.
115 new InstallerWindow();
123 BApplication::Quit();
125 if (!be_roster
->IsRunning(kDeskbarSignature
)) {
126 // Synchronize disks, and reboot the system
129 if (Utility::IsReadOnlyVolume("/boot")) {
130 // Unblock CD tray, and eject the CD
131 Utility::BlockMedia("/boot", false);
132 Utility::EjectMedia("/boot");
135 // Quickly reboot without possibly touching anything on disk
136 // (which we might just have ejected)
137 _kern_shutdown(true);