Namestitev zdaj vedno ustvari opravilo. Tudi če je že obstajalo od prej. Lahko je uporabnik aplikacijo opravila namestil zdaj v drugo mapo.
Dodal sem dokument s spiskom še odprtih zadev.
This commit is contained in:
parent
2f05e29657
commit
033454b291
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6,6 +6,7 @@ MSICALib/MSITSCA.vcxproj -text svneol=unset#text/xml
|
||||
MSICALib/MSITSCA.vcxproj.filters -text svneol=unset#text/xml
|
||||
MSICALib/MSITSCAOp.cpp -text
|
||||
MSICALib/MSITSCAOp.h -text
|
||||
MSICALib/Naredi.txt -text
|
||||
MSICALib/StdAfx.cpp -text
|
||||
MSICALib/StdAfx.h -text
|
||||
MSICALib/res/MSITSCA.rc -text svneol=unset#unset
|
||||
|
@ -115,7 +115,7 @@ UINT MSITSCA_API EvaluateScheduledTasks(MSIHANDLE hInstall)
|
||||
if (iAction >= INSTALLSTATE_LOCAL) {
|
||||
// Installing component. Add the task.
|
||||
PMSIHANDLE hViewTT;
|
||||
CMSITSCAOpCreateTask *opCreateTask = new CMSITSCAOpCreateTask(sDisplayName, iAction < INSTALLSTATE_LOCAL, MSITSCA_TASK_TICK_SIZE);
|
||||
CMSITSCAOpCreateTask *opCreateTask = new CMSITSCAOpCreateTask(sDisplayName, MSITSCA_TASK_TICK_SIZE);
|
||||
assert(opCreateTask);
|
||||
|
||||
// Populate the operation with task's data.
|
||||
|
@ -273,6 +273,7 @@
|
||||
<ResourceLocalizator Include="res\MSITSCA.rcx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Naredi.txt" />
|
||||
<None Include="res\en_GB.po" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
@ -50,5 +50,6 @@
|
||||
<None Include="res\en_GB.po">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="Naredi.txt" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -140,8 +140,7 @@ HRESULT CMSITSCAOpMoveFile::Execute(CMSITSCASession *pSession)
|
||||
// CMSITSCAOpCreateTask
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CMSITSCAOpCreateTask::CMSITSCAOpCreateTask(LPCWSTR pszTaskName, BOOL bForce, int iTicks) :
|
||||
m_bForce(bForce),
|
||||
CMSITSCAOpCreateTask::CMSITSCAOpCreateTask(LPCWSTR pszTaskName, int iTicks) :
|
||||
m_dwFlags(0),
|
||||
m_dwPriority(NORMAL_PRIORITY_CLASS),
|
||||
m_wIdleMinutes(0),
|
||||
@ -173,21 +172,13 @@ HRESULT CMSITSCAOpCreateTask::Execute(CMSITSCASession *pSession)
|
||||
if (MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ACTIONDATA, hRecordMsg) == IDCANCEL)
|
||||
return AtlHresultFromWin32(ERROR_INSTALL_USEREXIT);
|
||||
|
||||
// Load the task to see if it exists.
|
||||
hr = pSession->m_pTaskScheduler->Activate(m_sValue, IID_ITask, (IUnknown**)&pTask);
|
||||
if (SUCCEEDED(hr)) {
|
||||
// The task exists. Release it prematurely before proceeding.
|
||||
pTask.Detach()->Release();
|
||||
if (m_bForce) {
|
||||
// We're supposed to overwrite it. Delete the existing task first.
|
||||
// Since task deleting is a complicated job (when rollback/commit support is required), and we do have an operation for just that, we use it.
|
||||
{
|
||||
// Delete existing task first.
|
||||
// Since task deleting is a complicated job (when rollback/commit support is required), and we do have an operation just for that, we use it.
|
||||
// Don't worry, CMSITSCAOpDeleteTask::Execute() returns S_OK if task doesn't exist.
|
||||
CMSITSCAOpDeleteTask opDeleteTask(m_sValue);
|
||||
hr = opDeleteTask.Execute(pSession);
|
||||
if (FAILED(hr)) return hr;
|
||||
} else {
|
||||
// The task exists, and we're happy with that.
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// Create the new task.
|
||||
|
@ -128,7 +128,7 @@ public:
|
||||
class CMSITSCAOpCreateTask : public CMSITSCAOpSingleStringOperation
|
||||
{
|
||||
public:
|
||||
CMSITSCAOpCreateTask(LPCWSTR pszTaskName = L"", BOOL bForce = FALSE, int iTicks = 0);
|
||||
CMSITSCAOpCreateTask(LPCWSTR pszTaskName = L"", int iTicks = 0);
|
||||
virtual ~CMSITSCAOpCreateTask();
|
||||
virtual HRESULT Execute(CMSITSCASession *pSession);
|
||||
|
||||
@ -139,7 +139,6 @@ public:
|
||||
friend inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpCreateTask &op);
|
||||
|
||||
protected:
|
||||
BOOL m_bForce;
|
||||
CStringW m_sApplicationName;
|
||||
CStringW m_sParameters;
|
||||
CStringW m_sWorkingDirectory;
|
||||
@ -351,7 +350,6 @@ inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpCreateTask &op)
|
||||
POSITION pos;
|
||||
|
||||
hr = f << (const CMSITSCAOpSingleStringOperation&)op; if (FAILED(hr)) return hr;
|
||||
hr = f << (int)op.m_bForce; if (FAILED(hr)) return hr;
|
||||
hr = f << op.m_sApplicationName; if (FAILED(hr)) return hr;
|
||||
hr = f << op.m_sParameters; if (FAILED(hr)) return hr;
|
||||
hr = f << op.m_sWorkingDirectory; if (FAILED(hr)) return hr;
|
||||
@ -378,7 +376,6 @@ inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpCreateTask &op)
|
||||
DWORD dwValue;
|
||||
|
||||
hr = f >> (CMSITSCAOpSingleStringOperation&)op; if (FAILED(hr)) return hr;
|
||||
hr = f >> (int&)dwValue; if (FAILED(hr)) return hr; op.m_bForce = dwValue ? TRUE : FALSE;
|
||||
hr = f >> op.m_sApplicationName; if (FAILED(hr)) return hr;
|
||||
hr = f >> op.m_sParameters; if (FAILED(hr)) return hr;
|
||||
hr = f >> op.m_sWorkingDirectory; if (FAILED(hr)) return hr;
|
||||
|
3
MSICALib/Naredi.txt
Normal file
3
MSICALib/Naredi.txt
Normal file
@ -0,0 +1,3 @@
|
||||
- Dodano opravilo se ne vidi med opravili v Task Scheduler-ju.
|
||||
- Nadgradnja med odstranitvijo prejšnje verzije, izbriše opravilo, ki ga je nova verzija malo prej namestila.
|
||||
- Tudi akcije deferred/commit/rollback naj pošiljajo obvestila o napakah.
|
Loading…
x
Reference in New Issue
Block a user