Updater::Updater(QObject* parent) : QObject(parent) { QString appcast_url = QStringLiteral("https://releases.librevault.com/appcast_win.rss"); win_sparkle_set_appcast_url(appcast_url.toUtf8().data()); win_sparkle_set_registry_path("Software\\Librevault\\Updates"); win_sparkle_init(); }
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { // SHBrowseForFolder needs this, and says it's better to use OleInitialize than ComInitialize VERIFY_HRESULT(OleInitialize(NULL)); app_check_kill_date(); app_init_message_loop(); app_init_sparkle(); app_init_win32_ui(); mainwnd_init(); os_init(); // must be called before app_init_logging app_init_logging(); node_init(); mainwnd_show(); win_sparkle_init(); app_init_pings(); app_run_message_loop(); node_shutdown(); OleUninitialize(); return 0; }
JNIEXPORT void JNICALL Java_org_transterpreter_jeditwinsparkleplugin_JEditWinSparklePlugin_init (JNIEnv *env, jobject obj, jstring company, jstring app, jstring version, jstring url) { char c[1000], a[1000], v[1000], u[4000]; wchar_t wc[WIDE_LEN], wa[WIDE_LEN], wv[WIDE_LEN]; int len; memset(c, 0, 1000); memset(a, 0, 1000); memset(v, 0, 1000); memset(u, 0, 4000); memset(wc, 0, sizeof(wchar_t) * WIDE_LEN); memset(wa, 0, sizeof(wchar_t) * WIDE_LEN); memset(wv, 0, sizeof(wchar_t) * WIDE_LEN); len = env->GetStringLength(company); env->GetStringUTFRegion(company, 0, len, c); MultiByteToWideChar(CP_UTF8, 0, c, len, wc, WIDE_LEN); len = env->GetStringLength(app); env->GetStringUTFRegion(app, 0, len, a); MultiByteToWideChar(CP_UTF8, 0, a, len, wa, WIDE_LEN); len = env->GetStringLength(version); env->GetStringUTFRegion(version, 0, len, v); MultiByteToWideChar(CP_UTF8, 0, v, len, wv, WIDE_LEN); len = env->GetStringLength(url); env->GetStringUTFRegion(url, 0, len, u); win_sparkle_set_app_details(wc, wa, wv); win_sparkle_set_appcast_url(u); win_sparkle_init(); }
bool tm_winsparkle::checkInForeground () { if (running) return false; running = true; win_sparkle_init(); win_sparkle_check_update_with_ui(); return true; }
Updates::Updates(QObject *parent) : QObject(parent) { #if defined(Q_OS_MAC) _backend = new UpdatesOSX(); #elif defined(Q_OS_WIN32) win_sparkle_init(); #endif }
WinSparkleUpdater::WinSparkleUpdater( const QString& url ) { win_sparkle_set_appcast_url( url.toUtf8().data() ); win_sparkle_set_app_details( qApp->organizationName().toStdWString().c_str(), qApp->applicationName().toStdWString().c_str(), WIDEN(VERSION) ); win_sparkle_init(); }
void MainWindow::initWinSparkle() { // Setup updates feed. This must be done before win_sparkle_init(), but // could be also, often more conveniently, done using a VERSIONINFO Windows // resource. See the "psdk" example and its .rc file for an example of that // (these calls wouldn't be needed then). win_sparkle_set_appcast_url("http://winsparkle.org/example/appcast.xml"); win_sparkle_set_app_details(L"winsparkle.org", L"WinSparkle Qt Example", L"1.0"); // Initialize the updater and possibly show some UI win_sparkle_init(); }
bool tm_winsparkle::checkInBackground () { // WinSparkle docs state that configuration must be finished before the first // call to win_sparkle_init(), so we block any further attempts to change it. if (running) return false; running = true; win_sparkle_init(); #if WIN_SPARKLE_CHECK_VERSION(0,4,0) win_sparkle_check_update_without_ui(); #endif return true; }
WinLabexe::WinLabexe(QWidget *parent, Qt::WFlags flags) : GLabControlPanel(parent) { // that makes the code enter those respective dlls so that the workbenches get registered. LabExeImaging(); // LabExeOptimizing(); // Initialize WinSparkle as soon as the app itself is initialized, right before entering the event loop: win_sparkle_set_appcast_url("http://labexe.com/WinLabexe32AutoUpdate.xml"); wchar_t company_name[] = L"LabExe"; wchar_t app_name[] = L"WinLabexe"; wchar_t app_version[] = L"2.8.2"; win_sparkle_set_app_details(company_name, app_name, app_version); win_sparkle_init(); }
void MainWindow::initWinSparkle() { // Setup updates feed. This must be done before win_sparkle_init(), but // could be also, often more conveniently, done using a VERSIONINFO Windows // resource. See the "psdk" example and its .rc file for an example of that // (these calls wouldn't be needed then). win_sparkle_set_appcast_url("https://winsparkle.org/example/appcast.xml"); win_sparkle_set_app_details(L"winsparkle.org", L"WinSparkle Qt Example", L"1.0"); // Set DSA public key used to verify update's signature. // This is na example how to provide it from external source (i.e. from Qt // resource). See the "psdk" example and its .rc file for an example how to // provide the key using Windows resource. win_sparkle_set_dsa_pub_pem(reinterpret_cast<const char *>(QResource(":/pem/dsa_pub.pem").data())); // Initialize the updater and possibly show some UI win_sparkle_init(); }
int hextor_plugin_init (hextor_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg) { ph = plugin_handle; *plugin_name = name; *plugin_desc = desc; *plugin_version = version; win_sparkle_set_appcast_url (APPCAST_URL); win_sparkle_init (); hextor_hook_command (ph, "UPDCHK", HEXTOR_PRI_NORM, check_cmd, upd_help, NULL); hextor_command (ph, "MENU -ishare\\download.png ADD \"Help/Check for Updates\" \"UPDCHK\""); hextor_printf (ph, "%s plugin loaded\n", name); return 1; }
int WeaselServerApp::Run() { if (!m_server.Start()) return -1; //win_sparkle_set_appcast_url("http://localhost:8000/weasel/update/appcast.xml"); win_sparkle_set_registry_path("Software\\Rime\\Weasel\\Updates"); win_sparkle_init(); m_ui.Create(m_server.GetHWnd()); m_handler->Initialize(); int ret = m_server.Run(); m_handler->Finalize(); m_ui.Destroy(); win_sparkle_cleanup(); return ret; }
bool PoeditApp::OnInit() { if (!wxApp::OnInit()) return false; #if defined(__WXMAC__) wxSystemOptions::SetOption(wxMAC_TEXTCONTROL_USE_SPELL_CHECKER, 1); #endif #ifdef __WXMAC__ SetExitOnFrameDelete(false); #endif #if defined(__UNIX__) && !defined(__WXMAC__) wxStandardPaths::Get().SetInstallPrefix(POEDIT_PREFIX); wxString home = wxGetHomeDir() + "/"; // create Poedit cfg dir, move ~/.poedit to ~/.poedit/config // (upgrade from older versions of Poedit which used ~/.poedit file) if (!wxDirExists(home + ".poedit")) { if (wxFileExists(home + ".poedit")) wxRenameFile(home + ".poedit", home + ".poedit2"); wxMkdir(home + ".poedit"); if (wxFileExists(home + ".poedit2")) wxRenameFile(home + ".poedit2", home + ".poedit/config"); } #endif SetVendorName("Vaclav Slavik"); SetAppName("Poedit"); #if defined(__WXMAC__) #define CFG_FILE (wxStandardPaths::Get().GetUserConfigDir() + "/net.poedit.Poedit.cfg") #elif defined(__UNIX__) #define CFG_FILE (home + ".poedit/config") #else #define CFG_FILE wxEmptyString #endif #ifdef __WXMAC__ // upgrade from the old location of config file: wxString oldcfgfile = wxStandardPaths::Get().GetUserConfigDir() + "/poedit.cfg"; if (wxFileExists(oldcfgfile) && !wxFileExists(CFG_FILE)) { wxRenameFile(oldcfgfile, CFG_FILE); } #endif wxConfigBase::Set( new wxConfig(wxEmptyString, wxEmptyString, CFG_FILE, wxEmptyString, wxCONFIG_USE_GLOBAL_FILE | wxCONFIG_USE_LOCAL_FILE)); wxConfigBase::Get()->SetExpandEnvVars(false); wxImage::AddHandler(new wxPNGHandler); wxXmlResource::Get()->InitAllHandlers(); #if defined(__WXMAC__) wxXmlResource::Get()->Load(wxStandardPaths::Get().GetResourcesDir() + "/*.xrc"); #elif defined(__WXMSW__) wxStandardPaths::Get().DontIgnoreAppSubDir(); wxXmlResource::Get()->Load(wxStandardPaths::Get().GetResourcesDir() + "\\Resources\\*.xrc"); #else InitXmlResource(); #endif SetDefaultCfg(wxConfig::Get()); #if defined(__WXMAC__) || defined(__WXMSW__) u_setDataDirectory(wxStandardPaths::Get().GetResourcesDir().mb_str()); #endif #ifndef __WXMAC__ wxArtProvider::PushBack(new PoeditArtProvider); #endif SetupLanguage(); #ifdef __WXMAC__ wxMenuBar *bar = wxXmlResource::Get()->LoadMenuBar("mainmenu_mac_global"); TweakOSXMenuBar(bar); wxMenuBar::MacSetCommonMenuBar(bar); // so that help menu is correctly merged with system-provided menu // (see http://sourceforge.net/tracker/index.php?func=detail&aid=1600747&group_id=9863&atid=309863) s_macHelpMenuTitleName = _("&Help"); #endif FileHistory().Load(*wxConfig::Get()); // NB: It's important to do this before TM is used for the first time. if ( !MigrateLegacyTranslationMemory() ) return false; // NB: opening files or creating empty window is handled differently on // Macs, using MacOpenFiles() and MacNewFile(), so don't create empty // window if no files are given on command line; but still support // passing files on command line if (!gs_filesToOpen.empty()) { OpenFiles(gs_filesToOpen); gs_filesToOpen.clear(); } #ifndef __WXMAC__ else { OpenNewFile(); } #endif // !__WXMAC__ #ifdef USE_SPARKLE Sparkle_Initialize(CheckForBetaUpdates()); #endif // USE_SPARKLE #ifdef __WXMSW__ const char *appcast = "http://releases.poedit.net/appcast-win"; if ( CheckForBetaUpdates() ) { // Beta versions use unstable feed. appcast = "http://releases.poedit.net/appcast-win/beta"; } win_sparkle_set_appcast_url(appcast); win_sparkle_init(); #endif return true; }
int main(int argc, char *argv[]) { QApplication a(argc, argv); // Open the log file and install our handler. QString logPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/Revive/"; if (QDir().mkpath(logPath)) { g_LogFile = new QFile(logPath + "ReviveOverlay.txt"); g_LogFile->open(QIODevice::WriteOnly | QIODevice::Truncate); } qInstallMessageHandler(myMessageOutput); // Handle command-line arguments if (a.arguments().contains("-manifest")) { // Only initialize the manifest vr::EVRInitError err = vr::VRInitError_None; vr::VR_Init( &err, vr::VRApplication_Utility ); if ( err != vr::VRInitError_None ) return -1; QString filePath = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + "/app.vrmanifest"); vr::VRApplications()->AddApplicationManifest(qPrintable(filePath)); vr::VRApplications()->SetApplicationAutoLaunch(CReviveManifestController::AppKey, true); vr::VR_Shutdown(); return 0; } // Check if we need to copy over input files QString inputPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/Revive/Input/"; if (!QDir().exists(inputPath) && QDir().mkpath(inputPath)) { QDir inputDir(QCoreApplication::applicationDirPath() + "/Input"); if (inputDir.exists()) { QStringList names = inputDir.entryList(QStringList("*.json")); QStringList files; for (QString file : names) files.append(inputDir.path() + "/" + file); WindowsServices::CopyFiles(files, inputPath, names); } } if (COpenVROverlayController::SharedInstance()->Init()) { // If the dashboard was successfully created keep running in the background a.setQuitOnLastWindowClosed(false); } if (!CTrayIconController::SharedInstance()->Init()) qDebug("Failed to initialize the tray icon"); if (!CReviveManifestController::SharedInstance()->Init()) qDebug("Failed to initialize the revive manifest"); // Create a QML engine. QQmlEngine qmlEngine; qmlEngine.rootContext()->setContextProperty("Revive", CReviveManifestController::SharedInstance()); qmlEngine.rootContext()->setContextProperty("OpenVR", COpenVROverlayController::SharedInstance()); QQmlComponent qmlComponent( &qmlEngine, QUrl("qrc:/Overlay.qml")); if (qmlComponent.isError()) { qDebug(qUtf8Printable(qmlComponent.errorString())); return -1; } QObject *rootObject = qmlComponent.create(); QQuickItem *rootItem = qobject_cast<QQuickItem*>( rootObject ); COpenVROverlayController::SharedInstance()->SetQuickItem( rootItem ); win_sparkle_set_appcast_url("https://raw.githubusercontent.com/LibreVR/Revive/master/appcast.xml"); win_sparkle_set_can_shutdown_callback([]() { return (BOOL)!QApplication::startingUp(); }); win_sparkle_set_shutdown_request_callback([]() { CTrayIconController::SharedInstance()->quit(); }); win_sparkle_init(); QObject::connect(&a, &QApplication::aboutToQuit, win_sparkle_cleanup); return a.exec(); }
WinSparkleAutoUpdater::WinSparkleAutoUpdater() { win_sparkle_set_appcast_url(appcastUrl); win_sparkle_init(); }