MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / WriteRunOnceEntry

Method WriteRunOnceEntry

src/Setup/FxHelper.cpp:395–411  ·  view source on GitHub ↗

Write a runonce entry to the registry to tell it to continue with setup after a reboot

Source from the content-addressed store, hash-verified

393// setup after a reboot
394//
395bool CFxHelper::WriteRunOnceEntry()
396{
397 ATL::CRegKey key;
398
399 if (key.Open(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce", KEY_WRITE) != ERROR_SUCCESS) {
400 return false;
401 }
402
403 TCHAR exePath[MAX_PATH];
404 GetModuleFileName(NULL, exePath, MAX_PATH);
405
406 if (key.SetStringValue(L"SquirrelInstall", exePath) != ERROR_SUCCESS) {
407 return false;
408 }
409
410 return true;
411}
412
413bool CFxHelper::RebootSystem()
414{

Callers

nothing calls this directly

Calls 2

SetStringValueMethod · 0.80
OpenMethod · 0.45

Tested by

no test coverage detected