本文整理汇总了C++中Uninstall函数的典型用法代码示例。如果您正苦于以下问题:C++ Uninstall函数的具体用法?C++ Uninstall怎么用?C++ Uninstall使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Uninstall函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
BOOL CDialog::OnCommand(int id, int code)
{
switch(id)
{
case IDOK:
if(m_bNewVersion)
{
if( Uninstall() )
return Install();
else
{
// Write something to RunOnce registry key
// Keep in mind that Uninstall() already did!
SetMessage( IDS_RESTARTBEFOREUPDATE );
}
}
else if(m_bUnInstall)
return Uninstall();
else
return Install();
break;
case IDCANCEL:
if(m_bUnInstall)
CreateUninstall(TRUE);
::PostQuitMessage(1);
break;
}
return FALSE;
}
示例2: QThread
int Backend::GoBack(){
QThread *worker = new QThread();;
this->moveToThread(worker);
worker->start();
connect(this, SIGNAL(Uninstall()), this, SLOT(AsyncUninstall()));
emit Uninstall();
return Success;
}
示例3: OnUninstall
int OnUninstall(HWND hDlg)
{
SetWindowText(GetDlgItem(hDlg, IDC_QUESTION_TEXT), L"");
ShowWindow(GetDlgItem(hDlg, IDC_BTN_UNINSTALL), SW_HIDE);
ShowWindow(GetDlgItem(hDlg, IDCANCEL), SW_HIDE);
ShowWindow(GetDlgItem(hDlg, IDC_PROGRESS), SW_SHOW);
SendMessage(GetDlgItem(hDlg, IDC_PROGRESS), PBM_SETRANGE, 0, (LPARAM) MAKELPARAM (0, c_nMaxDirs));
SendMessage(GetDlgItem(hDlg, IDC_PROGRESS), PBM_SETPOS, 0, 0);
UpdateWindow(hDlg); // make sure the text is drawn
int ret = Uninstall(hDlg);
if (ret == ErrOK)
{
SetWindowText(GetDlgItem(hDlg, IDC_STATIC_TEXT), Strings.GetString(StrID_UninstalledSuccessfully));
}
else
{
//TODO: Localize this message. It might be shown later when the errors will be handled
SetWindowText(GetDlgItem(hDlg, IDC_STATIC_TEXT), L"There were errors during uninstallation.");
}
ShowWindow(GetDlgItem(hDlg, IDC_PROGRESS), SW_HIDE);
ShowWindow(GetDlgItem(hDlg, IDOK), SW_SHOW);
return ret;
}
示例4: Uninstall
void Vehicle::Dismiss()
{
sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Dismiss Entry: %u, GuidLow %u", _creatureEntry, _me->GetGUIDLow());
Uninstall();
_me->DestroyForNearbyPlayers();
_me->AddObjectToRemoveList();
}
示例5: Uninstall
status_t
BTeamDebugger::Install(team_id team)
{
Uninstall();
// create a debugger port
char name[B_OS_NAME_LENGTH];
snprintf(name, sizeof(name), "debugger for team %" B_PRId32, team);
fDebuggerPort = create_port(100, name);
if (fDebuggerPort < 0)
return fDebuggerPort;
port_id nubPort = install_team_debugger(team, fDebuggerPort);
if (nubPort < 0) {
delete_port(fDebuggerPort);
fDebuggerPort = -1;
return nubPort;
}
status_t error = BDebugContext::Init(team, nubPort);
if (error != B_OK) {
remove_team_debugger(team);
delete_port(fDebuggerPort);
fDebuggerPort = -1;
return error;
}
return B_OK;
}
示例6: DllInstall
STDAPI DllInstall( BOOL bInstall, LPCWSTR pszCmdLine )
{
// To install into System32\ShellExt
// regsvr32.exe /i /n HashCheck.dll
//
// To install without registering an uninstaller
// regsvr32.exe /i:"NoUninstall" /n HashCheck.dll
//
// To install in-place (without copying the .dll anywhere)
// regsvr32.exe /i:"NoCopy" /n HashCheck.dll
//
// To install with both options above
// regsvr32.exe /i:"NoUninstall NoCopy" /n HashCheck.dll
//
// To uninstall
// regsvr32.exe /u /i /n HashCheck.dll
//
// To install/uninstall silently
// regsvr32.exe /s ...
//
// DllInstall can also be invoked from a RegisterDlls INF section or from
// a UnregisterDlls INF section, if the registration flags are set to 2.
// Consult the documentation for RegisterDlls/UnregisterDlls for details.
return( (bInstall) ?
Install(pszCmdLine == NULL || StrStrIW(pszCmdLine, L"NoUninstall") == NULL,
pszCmdLine == NULL || StrStrIW(pszCmdLine, L"NoCopy") == NULL) :
Uninstall()
);
}
示例7: Uninstall
void CServiceModule::SetupAsLocalServer()
{
USES_CONVERSION;
CRegKey keyClasses,key;
LPOLESTR pCLSID;
Uninstall();
if (keyClasses.Open(HKEY_CLASSES_ROOT, _T("CLSID")) != ERROR_SUCCESS)
return;
_ATL_OBJMAP_ENTRY* pEntry = m_pObjMap;
while (pEntry->pclsid != NULL)
{
StringFromCLSID(*pEntry->pclsid, &pCLSID);
CString csTemp = pCLSID;
if (key.Open(keyClasses, (LPCTSTR)csTemp) == ERROR_SUCCESS)
{
TCHAR szModule[_MAX_PATH];
key.DeleteValue(_T("AppID"));
key.DeleteValue(_T("_LocalServer32"));
GetModuleFileName(GetModuleInstance(), szModule, _MAX_PATH);
key.SetKeyValue(_T("LocalServer32"), szModule, _T(""));
}
pEntry++;
}
}
示例8: RegisterAppId
inline HRESULT RegisterAppId(bool bService = false) throw()
{
if (!Uninstall())
return E_FAIL;
HRESULT hr = UpdateRegistryAppId(TRUE);
if (FAILED(hr))
return hr;
CRegKey keyAppID;
LONG lRes = keyAppID.Open(HKEY_CLASSES_ROOT, _T("AppID"), KEY_WRITE);
if (lRes != ERROR_SUCCESS)
return AtlHresultFromWin32(lRes);
CRegKey key;
lRes = key.Create(keyAppID, GetAppIdT());
if (lRes != ERROR_SUCCESS)
return AtlHresultFromWin32(lRes);
key.DeleteValue(_T("LocalService"));
if (!bService)
return S_OK;
key.SetStringValue(_T("LocalService"), m_szServiceName);
// Create service
if (!Install())
return E_FAIL;
return S_OK;
}
示例9: Uninstall
CHook::~CHook()
{
if ( Installed() )
{
Uninstall();
}
if ( m_lpBack != NULL )
{
delete [] m_lpBack;
m_lpBack = NULL;
}
if ( m_pMProt != NULL )
{
MemoryHackingFactory::DestroyMProt( m_pMProt );
m_pMProt = NULL;
}
if ( m_pMAlloc != NULL )
{
MemoryHackingFactory::DestroyMAlloc( m_pMAlloc );
m_pMProt = NULL;
}
}
示例10: IniParser
void ServiceUninstall::PreUninstall()
{
ip = new IniParser();
ip->Parse(UninstallIniPath);
if (ip->Error != 0)
{
if (dialog)
{
String s = "Errore durante il parse del file INI: " + to_wstring(ip->Error);
MessageBox(dialog->m_hWnd, s.lpcwstr(), _T("INI Parse Error"), 0);
dialog->EndDialog(-1);
}
return;
}
String s = "Uninstall "+ ip->AppName + " - "+ ip->AppVersion.getVersion();
if (dialog)
{
SetDlgItemText(dialog->m_hWnd, IDC_STATIC_TITOLO, s.lpcwstr());
SetWindowText(dialog->m_hWnd, s.lpcwstr());
}
if (dialog)
UninstallGUI();
else
Uninstall();
}
示例11: if
int win_svc_base::Main( int argc, char * argv[] )
{
//////////////////////////////////////////////////////////////////////////
/// 命令行参数解析
boost::program_options::options_description opts;
opts.add_options()
("help", "options: --install --uninstall")
("install", "")
("uninstall", "")
("auto-start", "");
boost::program_options::store(
boost::program_options::parse_command_line(argc, argv, opts)
, m_vm );
//////////////////////////////////////////////////////////////////////////
/// 定义SERVICE_TABLE_ENTRY DispatchTable[] 结构
SERVICE_TABLE_ENTRYA DispatchTable[2] =
{
{(char*)GetServiceName(), (LPSERVICE_MAIN_FUNCTIONA)GetServiceStartFunction()},
{NULL, NULL}
};
if ( m_vm.count("help") )
{
/// 帮助
std::cout << opts << std::endl;
}
else if ( m_vm.count("install") )
{
bool bAutoStart = (m_vm.count("auto-start") > 0);
/// 安装服务
if ( Install(bAutoStart) )
{
std::cout << "安装成功!" << std::endl;
OnInstall(bAutoStart);
}
else
std::cout << "安装失败!" << std::endl;
}
else if ( m_vm.count("uninstall") )
{
/// 卸载服务
if ( Uninstall() )
std::cout << "卸载成功!" << std::endl;
else
std::cout << "卸载失败!" << std::endl;
}
else
{
/// OS启动该程序
BOOL bSuccessed = ::StartServiceCtrlDispatcherA(DispatchTable);
//if (bSuccessed)
// LOG << "服务入口函数注册成功!" << std::endl;
//else
// LOG << "服务入口函数注册失败!" << std::endl;
}
return 0;
}
示例12: Uninstall
void Vehicle::Dismiss()
{
sLog.outDebug("Vehicle::Dismiss %u", me->GetEntry());
Uninstall();
me->SendObjectDeSpawnAnim(me->GetGUID());
me->CombatStop();
me->AddObjectToRemoveList();
}
示例13: Uninstall
void
BPackageManager::Uninstall(const char* const* packages, int packageCount)
{
BSolverPackageSpecifierList packagesToUninstall;
if (!packagesToUninstall.AppendSpecifiers(packages, packageCount))
throw std::bad_alloc();
Uninstall(packagesToUninstall);
}
示例14: Uninstall
void Vehicle::Dismiss()
{
if (GetBase()->GetTypeId() != TYPEID_UNIT)
return;
sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Dismiss Entry: %u, GuidLow %u", _creatureEntry, _me->GetGUIDLow());
Uninstall();
GetBase()->ToCreature()->DespawnOrUnsummon();
}
示例15: LOG4CPLUS_DEBUG
long ServiceModule::RegisterServer(bool bService)
{
LOG4CPLUS_DEBUG(log,"register server.");
Uninstall();
if (bService)
{
return Install();
}
return 0;
}