Dodal sem polno podporo za Task Scheduler 2.0.

Dodal sem obvestila o napakah pri delu z razporejenimi opravili.

Estetski popravki
This commit is contained in:
Simon Rozman 2013-01-09 13:14:41 +00:00
parent 99c6bc3ac4
commit d5162a64d7
11 changed files with 765 additions and 428 deletions

1
.gitattributes vendored
View File

@ -6,7 +6,6 @@ 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

View File

@ -30,6 +30,7 @@ ScheduledTask Flags N DoubleInteger Task's flags to pass in IScheduledWorkI
ScheduledTask Priority N DoubleInteger 32;64;128;256;16384,32768 Task's priority to pass in ITask::SetPriority() call.
ScheduledTask User Y Formatted Account name to run task as. Use empty string for system account.
ScheduledTask Password Y Formatted Account password to run task as. Use NULL for system account.
ScheduledTask Author Y Formatted Task author.
ScheduledTask Description Y Formatted Task description.
ScheduledTask IdleMin Y Integer A value that specifies how long, in minutes, the system must remain idle before the work item can run.
ScheduledTask IdleDeadline Y Integer A value that specifies the maximum number of minutes that the Task Scheduler will wait for the idle-time period.
@ -131,12 +132,16 @@ Vse :: "$(JEZIK).$(CFG).$(PLAT).Error-2.idt"
Error Message
i2 L0
1250 Error Error
2550 Pri odpiranju namestitvenega paketa je prišlo do napake.
2551 Pri pripravi seznama razvršèenih opravil je prišlo do napake [2].
2552 Pri pisanju v datoteko seznama razporejenih opravil »[2]« je prišlo do napake [3].
2553 Pri nastavljanju parametra »[2]« je prišlo do napake [3].
2554 Pri brisanju datoteke »[2]« je prišlo do napake [3].
2555 Pri premikanju datoteke »[2]« v »[3]« je prišlo do napake [4].
2550 Pri odpiranju namestitvenega paketa je prišlo do napake. Obrnite se na svojo tehnično službo.
2551 Pri pripravi seznama razvrščenih opravil je prišlo do napake [2]. Obrnite se na svojo tehnično službo.
2552 Pri pisanju v datoteko seznama razporejenih opravil »[2]« je prišlo do napake [3]. Obrnite se na svojo tehnično službo.
2553 Pri nastavljanju parametra »[2]« je prišlo do napake [3]. Obrnite se na svojo tehnično službo.
2554 Pri brisanju datoteke »[2]« je prišlo do napake [3]. Obrnite se na svojo tehnično službo.
2555 Pri premikanju datoteke »[2]« v »[3]« je prišlo do napake [4]. Obrnite se na svojo tehnično službo.
2556 Pri ustvarjanju razporejenega opravila »[2]« je prišlo do napake [3]. Obrnite se na svojo tehnično službo.
2557 Pri brisanju razporejenega opravila »[2]« je prišlo do napake [3]. Obrnite se na svojo tehnično službo.
2558 Pri o(ne)mogočanju razporejenega opravila »[2]« je prišlo do napake [3]. Obrnite se na svojo tehnično službo.
2559 Pri kopiranju razporejenega opravila »[2]« v »[3]« je prišlo do napake [4]. Obrnite se na svojo tehnično službo.
<<NOKEEP
"De.$(CFG).$(PLAT).Error-2.idt" : "Sl.$(CFG).$(PLAT).Error-2.idtx" "..\res\de_DE.po"
@ -178,8 +183,8 @@ Vse :: "$(JEZIK).$(CFG).$(PLAT).ScheduledTask-1.idt"
"$(JEZIK).$(CFG).$(PLAT).ScheduledTask-1.idt" : "Makefile" "..\..\include\MSINast.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Task DisplayName Application Parameters WorkingDir Flags Priority User Password Description IdleMin IdleDeadline MaxRuntime Condition Component_
s$(MSI_TIP_ID) s255 s255 S255 s255 i4 i4 S255 S255 S255 I2 I2 i4 S255 s$(MSI_TIP_ID)
Task DisplayName Application Parameters WorkingDir Flags Priority User Password Author Description IdleMin IdleDeadline MaxRuntime Condition Component_
s$(MSI_TIP_ID) s255 s255 S255 s255 i4 i4 S255 S255 S255 S255 I2 I2 i4 S255 s$(MSI_TIP_ID)
ScheduledTask Task
<<NOKEEP

View File

@ -52,14 +52,16 @@ UINT MSITSCA_API EvaluateScheduledTasks(MSIHANDLE hInstall)
CString sValue;
assert(hRecordProg);
#ifdef ASSERT_TO_DEBUG
assert(0); // Attach debugger here, or press "Ignore"!
#endif
// Check and add the rollback enabled state.
uiResult = ::MsiGetProperty(hInstall, _T("RollbackDisabled"), sValue);
bRollbackEnabled = uiResult == ERROR_SUCCESS ?
_wtoi(sValue) || !sValue.IsEmpty() && towlower(sValue.GetAt(0)) == L'y' ? FALSE : TRUE :
TRUE;
olExecute.AddTail(new CMSITSCAOpEnableRollback(bRollbackEnabled));
olExecute.AddTail(new CMSITSCAOpRollbackEnable(bRollbackEnabled));
// Open MSI database.
hDatabase = ::MsiGetActiveDatabase(hInstall);
@ -70,7 +72,7 @@ UINT MSITSCA_API EvaluateScheduledTasks(MSIHANDLE hInstall)
PMSIHANDLE hViewST;
// Prepare a query to get a list/view of tasks.
uiResult = ::MsiDatabaseOpenView(hDatabase, _T("SELECT Task,DisplayName,Application,Parameters,WorkingDir,Flags,Priority,User,Password,Description,IdleMin,IdleDeadline,MaxRuntime,Condition,Component_ FROM ScheduledTask"), &hViewST);
uiResult = ::MsiDatabaseOpenView(hDatabase, _T("SELECT Task,DisplayName,Application,Parameters,WorkingDir,Flags,Priority,User,Password,Author,Description,IdleMin,IdleDeadline,MaxRuntime,Condition,Component_ FROM ScheduledTask"), &hViewST);
if (uiResult == ERROR_SUCCESS) {
// Execute query!
uiResult = ::MsiViewExecute(hViewST, NULL);
@ -91,8 +93,8 @@ UINT MSITSCA_API EvaluateScheduledTasks(MSIHANDLE hInstall)
break;
// Read and evaluate task's condition.
uiResult = ::MsiRecordGetString(hRecord, 14, sValue);
if (uiResult != ERROR_SUCCESS) break; // TODO: If condition is empty string ommit evaluation.
uiResult = ::MsiRecordGetString(hRecord, 15, sValue);
if (uiResult != ERROR_SUCCESS) break;
condition = ::MsiEvaluateCondition(hInstall, sValue);
if (condition == MSICONDITION_FALSE)
continue;
@ -102,7 +104,7 @@ UINT MSITSCA_API EvaluateScheduledTasks(MSIHANDLE hInstall)
}
// Read task's Component ID.
uiResult = ::MsiRecordGetString(hRecord, 15, sValue);
uiResult = ::MsiRecordGetString(hRecord, 16, sValue);
if (uiResult != ERROR_SUCCESS) break;
// Get the component state.
@ -115,11 +117,12 @@ UINT MSITSCA_API EvaluateScheduledTasks(MSIHANDLE hInstall)
if (iAction >= INSTALLSTATE_LOCAL) {
// Component is or should be installed. Create the task.
PMSIHANDLE hViewTT;
CMSITSCAOpCreateTask *opCreateTask = new CMSITSCAOpCreateTask(sDisplayName, MSITSCA_TASK_TICK_SIZE);
CMSITSCAOpTaskCreate *opCreateTask = new CMSITSCAOpTaskCreate(sDisplayName, MSITSCA_TASK_TICK_SIZE);
assert(opCreateTask);
// Populate the operation with task's data.
opCreateTask->SetFromRecord(hInstall, hRecord);
uiResult = opCreateTask->SetFromRecord(hInstall, hRecord);
if (uiResult != ERROR_SUCCESS) break;
// Perform another query to get task's triggers.
uiResult = ::MsiDatabaseOpenView(hDatabase, _T("SELECT Trigger,BeginDate,EndDate,StartTime,StartTimeRand,MinutesDuration,MinutesInterval,Flags,Type,DaysInterval,WeeksInterval,DaysOfTheWeek,DaysOfMonth,WeekOfMonth,MonthsOfYear FROM TaskTrigger WHERE Task_=?"), &hViewTT);
@ -138,7 +141,7 @@ UINT MSITSCA_API EvaluateScheduledTasks(MSIHANDLE hInstall)
olExecute.AddTail(opCreateTask);
} else if (iAction >= INSTALLSTATE_REMOVED) {
// Component is installed, but should be degraded to advertised/removed. Delete the task.
olExecute.AddTail(new CMSITSCAOpDeleteTask(sDisplayName, MSITSCA_TASK_TICK_SIZE));
olExecute.AddTail(new CMSITSCAOpTaskDelete(sDisplayName, MSITSCA_TASK_TICK_SIZE));
}
// The amount of tick space to add for each task to progress indicator.
@ -235,7 +238,9 @@ UINT MSITSCA_API InstallScheduledTasks(MSIHANDLE hInstall)
BOOL bIsCoInitialized = SUCCEEDED(::CoInitialize(NULL));
CString sSequenceFilename;
#ifdef ASSERT_TO_DEBUG
assert(0); // Attach debugger here, or press "Ignore"!
#endif
uiResult = ::MsiGetProperty(hInstall, _T("CustomActionData"), sSequenceFilename);
if (uiResult == ERROR_SUCCESS) {
@ -252,9 +257,6 @@ UINT MSITSCA_API InstallScheduledTasks(MSIHANDLE hInstall)
// In case of commit/rollback, continue sequence on error, to do as much cleanup as possible.
session.m_bContinueOnError = bIsCleanup;
// Get task scheduler object.
hr = session.m_pTaskScheduler.CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL);
if (SUCCEEDED(hr)) {
// Execute the operations.
hr = lstOperations.Execute(&session);
if (SUCCEEDED(hr)) {
@ -267,8 +269,8 @@ UINT MSITSCA_API InstallScheduledTasks(MSIHANDLE hInstall)
sSequenceFilenameCM.Format(_T("%.*ls-cm%ls"), pszExtension - (LPCTSTR)sSequenceFilename, (LPCTSTR)sSequenceFilename, pszExtension);
// After end of commit, delete rollback file too. After end of rollback, delete commit file too.
session.m_olCommit.AddTail(new CMSITSCAOpDeleteFile(sSequenceFilenameRB));
session.m_olRollback.AddTail(new CMSITSCAOpDeleteFile(sSequenceFilenameCM));
session.m_olCommit.AddTail(new CMSITSCAOpFileDelete(sSequenceFilenameRB));
session.m_olRollback.AddTail(new CMSITSCAOpFileDelete(sSequenceFilenameCM));
// Save commit file first.
hr = session.m_olCommit.SaveToFile(sSequenceFilenameCM);
@ -301,10 +303,6 @@ UINT MSITSCA_API InstallScheduledTasks(MSIHANDLE hInstall)
session.m_bRollbackEnabled = FALSE;
verify(SUCCEEDED(session.m_olRollback.Execute(&session)));
}
} else {
// Task scheduler creation failed.
uiResult = HRESULT_CODE(hr);
}
} else {
// Sequence loading failed. Don't panic => do nothing.
uiResult = ERROR_SUCCESS;

View File

@ -45,6 +45,10 @@
#define ERROR_INSTALL_SCHEDULED_TASKS_PROPERTY_SET 2553L
#define ERROR_INSTALL_DELETE_FAILED 2554L
#define ERROR_INSTALL_MOVE_FAILED 2555L
#define ERROR_INSTALL_TASK_CREATE_FAILED 2556L
#define ERROR_INSTALL_TASK_DELETE_FAILED 2557L
#define ERROR_INSTALL_TASK_ENABLE_FAILED 2558L
#define ERROR_INSTALL_TASK_COPY_FAILED 2559L
////////////////////////////////////////////////////////////////////

View File

@ -273,7 +273,6 @@
<ResourceLocalizator Include="res\MSITSCA.rcx" />
</ItemGroup>
<ItemGroup>
<None Include="Naredi.txt" />
<None Include="res\en_GB.po" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -50,6 +50,5 @@
<None Include="res\en_GB.po">
<Filter>Resource Files</Filter>
</None>
<None Include="Naredi.txt" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -34,16 +34,16 @@ protected:
////////////////////////////////////////////////////////////////////////////
// CMSITSCAOpSingleStringOperation
// CMSITSCAOpTypeSingleString
////////////////////////////////////////////////////////////////////////////
class CMSITSCAOpSingleStringOperation : public CMSITSCAOp
class CMSITSCAOpTypeSingleString : public CMSITSCAOp
{
public:
CMSITSCAOpSingleStringOperation(LPCWSTR pszValue = L"", int iTicks = 0);
CMSITSCAOpTypeSingleString(LPCWSTR pszValue = L"", int iTicks = 0);
friend inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpSingleStringOperation &op);
friend inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpSingleStringOperation &op);
friend inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpTypeSingleString &op);
friend inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpTypeSingleString &op);
protected:
CStringW m_sValue;
@ -54,13 +54,13 @@ protected:
// CMSITSCAOpDoubleStringOperation
////////////////////////////////////////////////////////////////////////////
class CMSITSCAOpSrcDstStringOperation : public CMSITSCAOp
class CMSITSCAOpTypeSrcDstString : public CMSITSCAOp
{
public:
CMSITSCAOpSrcDstStringOperation(LPCWSTR pszValue1 = L"", LPCWSTR pszValue2 = L"", int iTicks = 0);
CMSITSCAOpTypeSrcDstString(LPCWSTR pszValue1 = L"", LPCWSTR pszValue2 = L"", int iTicks = 0);
friend inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpSrcDstStringOperation &op);
friend inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpSrcDstStringOperation &op);
friend inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpTypeSrcDstString &op);
friend inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpTypeSrcDstString &op);
protected:
CStringW m_sValue1;
@ -69,16 +69,16 @@ protected:
////////////////////////////////////////////////////////////////////////////
// CMSITSCAOpBooleanOperation
// CMSITSCAOpTypeBoolean
////////////////////////////////////////////////////////////////////////////
class CMSITSCAOpBooleanOperation : public CMSITSCAOp
class CMSITSCAOpTypeBoolean : public CMSITSCAOp
{
public:
CMSITSCAOpBooleanOperation(BOOL bValue = TRUE, int iTicks = 0);
CMSITSCAOpTypeBoolean(BOOL bValue = TRUE, int iTicks = 0);
friend inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpBooleanOperation &op);
friend inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpBooleanOperation &op);
friend inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpTypeBoolean &op);
friend inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpTypeBoolean &op);
protected:
BOOL m_bValue;
@ -86,62 +86,63 @@ protected:
////////////////////////////////////////////////////////////////////////////
// CMSITSCAOpEnableRollback
// CMSITSCAOpRollbackEnable
////////////////////////////////////////////////////////////////////////////
class CMSITSCAOpEnableRollback : public CMSITSCAOpBooleanOperation
class CMSITSCAOpRollbackEnable : public CMSITSCAOpTypeBoolean
{
public:
CMSITSCAOpEnableRollback(BOOL bEnable = TRUE, int iTicks = 0);
CMSITSCAOpRollbackEnable(BOOL bEnable = TRUE, int iTicks = 0);
virtual HRESULT Execute(CMSITSCASession *pSession);
};
////////////////////////////////////////////////////////////////////////////
// CMSITSCAOpDeleteFile
// CMSITSCAOpFileDelete
////////////////////////////////////////////////////////////////////////////
class CMSITSCAOpDeleteFile : public CMSITSCAOpSingleStringOperation
class CMSITSCAOpFileDelete : public CMSITSCAOpTypeSingleString
{
public:
CMSITSCAOpDeleteFile(LPCWSTR pszFileName = L"", int iTicks = 0);
CMSITSCAOpFileDelete(LPCWSTR pszFileName = L"", int iTicks = 0);
virtual HRESULT Execute(CMSITSCASession *pSession);
};
////////////////////////////////////////////////////////////////////////////
// CMSITSCAOpMoveFile
// CMSITSCAOpFileMove
////////////////////////////////////////////////////////////////////////////
class CMSITSCAOpMoveFile : public CMSITSCAOpSrcDstStringOperation
class CMSITSCAOpFileMove : public CMSITSCAOpTypeSrcDstString
{
public:
CMSITSCAOpMoveFile(LPCWSTR pszFileSrc = L"", LPCWSTR pszFileDst = L"", int iTicks = 0);
CMSITSCAOpFileMove(LPCWSTR pszFileSrc = L"", LPCWSTR pszFileDst = L"", int iTicks = 0);
virtual HRESULT Execute(CMSITSCASession *pSession);
};
////////////////////////////////////////////////////////////////////////////
// CMSITSCAOpCreateTask
// CMSITSCAOpTaskCreate
////////////////////////////////////////////////////////////////////////////
class CMSITSCAOpCreateTask : public CMSITSCAOpSingleStringOperation
class CMSITSCAOpTaskCreate : public CMSITSCAOpTypeSingleString
{
public:
CMSITSCAOpCreateTask(LPCWSTR pszTaskName = L"", int iTicks = 0);
virtual ~CMSITSCAOpCreateTask();
CMSITSCAOpTaskCreate(LPCWSTR pszTaskName = L"", int iTicks = 0);
virtual ~CMSITSCAOpTaskCreate();
virtual HRESULT Execute(CMSITSCASession *pSession);
UINT SetFromRecord(MSIHANDLE hInstall, MSIHANDLE hRecord);
UINT SetTriggersFromView(MSIHANDLE hView);
friend inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpCreateTask &op);
friend inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpCreateTask &op);
friend inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpTaskCreate &op);
friend inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpTaskCreate &op);
protected:
CStringW m_sApplicationName;
CStringW m_sParameters;
CStringW m_sWorkingDirectory;
CStringW m_sAuthor;
CStringW m_sComment;
DWORD m_dwFlags;
DWORD m_dwPriority;
@ -156,29 +157,29 @@ protected:
////////////////////////////////////////////////////////////////////////////
// CMSITSCAOpDeleteTask
// CMSITSCAOpTaskDelete
////////////////////////////////////////////////////////////////////////////
class CMSITSCAOpDeleteTask : public CMSITSCAOpSingleStringOperation
class CMSITSCAOpTaskDelete : public CMSITSCAOpTypeSingleString
{
public:
CMSITSCAOpDeleteTask(LPCWSTR pszTaskName = L"", int iTicks = 0);
CMSITSCAOpTaskDelete(LPCWSTR pszTaskName = L"", int iTicks = 0);
virtual HRESULT Execute(CMSITSCASession *pSession);
};
////////////////////////////////////////////////////////////////////////////
// CMSITSCAOpEnableTask
// CMSITSCAOpTaskEnable
////////////////////////////////////////////////////////////////////////////
class CMSITSCAOpEnableTask : public CMSITSCAOpSingleStringOperation
class CMSITSCAOpTaskEnable : public CMSITSCAOpTypeSingleString
{
public:
CMSITSCAOpEnableTask(LPCWSTR pszTaskName = L"", BOOL bEnable = TRUE, int iTicks = 0);
CMSITSCAOpTaskEnable(LPCWSTR pszTaskName = L"", BOOL bEnable = TRUE, int iTicks = 0);
virtual HRESULT Execute(CMSITSCASession *pSession);
friend inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpEnableTask &op);
friend inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpEnableTask &op);
friend inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpTaskEnable &op);
friend inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpTaskEnable &op);
protected:
BOOL m_bEnable;
@ -186,13 +187,13 @@ protected:
////////////////////////////////////////////////////////////////////////////
// CMSITSCAOpCopyTask
// CMSITSCAOpTaskCopy
////////////////////////////////////////////////////////////////////////////
class CMSITSCAOpCopyTask : public CMSITSCAOpSrcDstStringOperation
class CMSITSCAOpTaskCopy : public CMSITSCAOpTypeSrcDstString
{
public:
CMSITSCAOpCopyTask(LPCWSTR pszTaskSrc = L"", LPCWSTR pszTaskDst = L"", int iTicks = 0);
CMSITSCAOpTaskCopy(LPCWSTR pszTaskSrc = L"", LPCWSTR pszTaskDst = L"", int iTicks = 0);
virtual HRESULT Execute(CMSITSCASession *pSession);
};
@ -243,7 +244,6 @@ public:
CMSITSCASession();
MSIHANDLE m_hInstall; // Installer handle
CComPtr<ITaskScheduler> m_pTaskScheduler; // Task scheduler interface
BOOL m_bContinueOnError; // Continue execution on operation error?
BOOL m_bRollbackEnabled; // Is rollback enabled?
CMSITSCAOpList m_olRollback; // Rollback operation list
@ -267,7 +267,7 @@ inline HRESULT operator >>(CAtlFile &f, CMSITSCAOp &op)
}
inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpSingleStringOperation &op)
inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpTypeSingleString &op)
{
HRESULT hr;
@ -278,7 +278,7 @@ inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpSingleStringOperation &o
}
inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpSingleStringOperation &op)
inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpTypeSingleString &op)
{
HRESULT hr;
@ -289,7 +289,7 @@ inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpSingleStringOperation &op)
}
inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpSrcDstStringOperation &op)
inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpTypeSrcDstString &op)
{
HRESULT hr;
@ -303,7 +303,7 @@ inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpSrcDstStringOperation &o
}
inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpSrcDstStringOperation &op)
inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpTypeSrcDstString &op)
{
HRESULT hr;
@ -317,7 +317,7 @@ inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpSrcDstStringOperation &op)
}
inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpBooleanOperation &op)
inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpTypeBoolean &op)
{
HRESULT hr;
@ -328,7 +328,7 @@ inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpBooleanOperation &op)
}
inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpBooleanOperation &op)
inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpTypeBoolean &op)
{
int iValue;
HRESULT hr;
@ -344,15 +344,16 @@ inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpBooleanOperation &op)
}
inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpCreateTask &op)
inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpTaskCreate &op)
{
HRESULT hr;
POSITION pos;
hr = f << (const CMSITSCAOpSingleStringOperation&)op; if (FAILED(hr)) return hr;
hr = f << (const CMSITSCAOpTypeSingleString&)op; 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;
hr = f << op.m_sAuthor; if (FAILED(hr)) return hr;
hr = f << op.m_sComment; if (FAILED(hr)) return hr;
hr = f << (int)op.m_dwFlags; if (FAILED(hr)) return hr;
hr = f << (int)op.m_dwPriority; if (FAILED(hr)) return hr;
@ -370,15 +371,16 @@ inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpCreateTask &op)
}
inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpCreateTask &op)
inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpTaskCreate &op)
{
HRESULT hr;
DWORD dwValue;
hr = f >> (CMSITSCAOpSingleStringOperation&)op; if (FAILED(hr)) return hr;
hr = f >> (CMSITSCAOpTypeSingleString&)op; 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;
hr = f >> op.m_sAuthor; if (FAILED(hr)) return hr;
hr = f >> op.m_sComment; if (FAILED(hr)) return hr;
hr = f >> (int&)op.m_dwFlags; if (FAILED(hr)) return hr;
hr = f >> (int&)op.m_dwPriority; if (FAILED(hr)) return hr;
@ -398,23 +400,23 @@ inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpCreateTask &op)
}
inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpEnableTask &op)
inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpTaskEnable &op)
{
HRESULT hr;
hr = f << (const CMSITSCAOpSingleStringOperation&)op;
hr = f << (const CMSITSCAOpTypeSingleString&)op;
if (FAILED(hr)) return hr;
return f << (int)op.m_bEnable;
}
inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpEnableTask &op)
inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpTaskEnable &op)
{
HRESULT hr;
int iTemp;
hr = f >> (CMSITSCAOpSingleStringOperation&)op;
hr = f >> (CMSITSCAOpTypeSingleString&)op;
if (FAILED(hr)) return hr;
hr = f >> iTemp;
@ -438,20 +440,20 @@ inline HRESULT operator <<(CAtlFile &f, const CMSITSCAOpList &list)
for (pos = list.GetHeadPosition(); pos;) {
const CMSITSCAOp *pOp = list.GetNext(pos);
if (dynamic_cast<const CMSITSCAOpEnableRollback*>(pOp))
hr = list.Save<CMSITSCAOpEnableRollback, CMSITSCAOpList::OPERATION_ENABLE_ROLLBACK>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpDeleteFile*>(pOp))
hr = list.Save<CMSITSCAOpDeleteFile, CMSITSCAOpList::OPERATION_DELETE_FILE>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpMoveFile*>(pOp))
hr = list.Save<CMSITSCAOpMoveFile, CMSITSCAOpList::OPERATION_MOVE_FILE>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpCreateTask*>(pOp))
hr = list.Save<CMSITSCAOpCreateTask, CMSITSCAOpList::OPERATION_CREATE_TASK>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpDeleteTask*>(pOp))
hr = list.Save<CMSITSCAOpDeleteTask, CMSITSCAOpList::OPERATION_DELETE_TASK>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpEnableTask*>(pOp))
hr = list.Save<CMSITSCAOpEnableTask, CMSITSCAOpList::OPERATION_ENABLE_TASK>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpCopyTask*>(pOp))
hr = list.Save<CMSITSCAOpCopyTask, CMSITSCAOpList::OPERATION_COPY_TASK>(f, pOp);
if (dynamic_cast<const CMSITSCAOpRollbackEnable*>(pOp))
hr = list.Save<CMSITSCAOpRollbackEnable, CMSITSCAOpList::OPERATION_ENABLE_ROLLBACK>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpFileDelete*>(pOp))
hr = list.Save<CMSITSCAOpFileDelete, CMSITSCAOpList::OPERATION_DELETE_FILE>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpFileMove*>(pOp))
hr = list.Save<CMSITSCAOpFileMove, CMSITSCAOpList::OPERATION_MOVE_FILE>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpTaskCreate*>(pOp))
hr = list.Save<CMSITSCAOpTaskCreate, CMSITSCAOpList::OPERATION_CREATE_TASK>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpTaskDelete*>(pOp))
hr = list.Save<CMSITSCAOpTaskDelete, CMSITSCAOpList::OPERATION_DELETE_TASK>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpTaskEnable*>(pOp))
hr = list.Save<CMSITSCAOpTaskEnable, CMSITSCAOpList::OPERATION_ENABLE_TASK>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpTaskCopy*>(pOp))
hr = list.Save<CMSITSCAOpTaskCopy, CMSITSCAOpList::OPERATION_COPY_TASK>(f, pOp);
else if (dynamic_cast<const CMSITSCAOpList*>(pOp))
hr = list.Save<CMSITSCAOpList, CMSITSCAOpList::OPERATION_SUBLIST>(f, pOp);
else {
@ -486,25 +488,25 @@ inline HRESULT operator >>(CAtlFile &f, CMSITSCAOpList &list)
switch ((CMSITSCAOpList::OPERATION)iTemp) {
case CMSITSCAOpList::OPERATION_ENABLE_ROLLBACK:
hr = list.LoadAndAddTail<CMSITSCAOpEnableRollback>(f);
hr = list.LoadAndAddTail<CMSITSCAOpRollbackEnable>(f);
break;
case CMSITSCAOpList::OPERATION_DELETE_FILE:
hr = list.LoadAndAddTail<CMSITSCAOpDeleteFile>(f);
hr = list.LoadAndAddTail<CMSITSCAOpFileDelete>(f);
break;
case CMSITSCAOpList::OPERATION_MOVE_FILE:
hr = list.LoadAndAddTail<CMSITSCAOpMoveFile>(f);
hr = list.LoadAndAddTail<CMSITSCAOpFileMove>(f);
break;
case CMSITSCAOpList::OPERATION_CREATE_TASK:
hr = list.LoadAndAddTail<CMSITSCAOpCreateTask>(f);
hr = list.LoadAndAddTail<CMSITSCAOpTaskCreate>(f);
break;
case CMSITSCAOpList::OPERATION_DELETE_TASK:
hr = list.LoadAndAddTail<CMSITSCAOpDeleteTask>(f);
hr = list.LoadAndAddTail<CMSITSCAOpTaskDelete>(f);
break;
case CMSITSCAOpList::OPERATION_ENABLE_TASK:
hr = list.LoadAndAddTail<CMSITSCAOpEnableTask>(f);
hr = list.LoadAndAddTail<CMSITSCAOpTaskEnable>(f);
break;
case CMSITSCAOpList::OPERATION_COPY_TASK:
hr = list.LoadAndAddTail<CMSITSCAOpCopyTask>(f);
hr = list.LoadAndAddTail<CMSITSCAOpTaskCopy>(f);
break;
case CMSITSCAOpList::OPERATION_SUBLIST:
hr = list.LoadAndAddTail<CMSITSCAOpList>(f);

View File

@ -1,3 +0,0 @@
- Naredi še o(ne)mogoèanje opravil z uporabo Task Scheduler 2.0.
- Preizkusi vse nastavitve opravila in vrste sprožilcev, èe se pravilno izdelajo.
- Tudi akcije deferred/commit/rollback naj pošiljajo obvestila o napakah.

View File

@ -20,7 +20,8 @@
#define _WIN32_WINNT 0x0501 // Include Windows XP symbols
#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
#ifdef _WINDLL
#define MSITSCA_DLL // Gradimo knjižnico DLL
#define MSITSCA_DLL // This is a DLL
//#ifdef ASSERT_TO_DEBUG // Enable false asserts to provide opportunity to attach debuger
#endif
#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: MSITSCA\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-12-24 14:20+0100\n"
"POT-Creation-Date: 2013-01-09 12:10+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <simon.rozman@amebis.si>\n"
@ -36,6 +36,10 @@ msgstr "0x409"
#: ..\MSI/Sl.DebugU.Win32.Error-2.idtx:3
#: ..\MSI/Sl.DebugU.x64.ActionText-2.idtx:3
#: ..\MSI/Sl.DebugU.x64.Error-2.idtx:3
#: ..\MSI/Sl.ReleaseU.Win32.ActionText-2.idtx:3
#: ..\MSI/Sl.ReleaseU.Win32.Error-2.idtx:3
#: ..\MSI/Sl.ReleaseU.x64.ActionText-2.idtx:3
#: ..\MSI/Sl.ReleaseU.x64.Error-2.idtx:3
msgid "1250"
msgstr "1252"
@ -72,44 +76,116 @@ msgstr "Copyright © Amebis, d. o. o., Kamnik, 2012"
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.Error-2.idtx:8 ..\MSI/Sl.DebugU.x64.Error-2.idtx:8
msgid "Pri brisanju datoteke »[2]« je prišlo do napake [3]."
msgstr "Error [3] deleting \"[2]\" file."
#: ..\MSI/Sl.ReleaseU.Win32.Error-2.idtx:8
#: ..\MSI/Sl.ReleaseU.x64.Error-2.idtx:8
msgid ""
"Pri brisanju datoteke »[2]« je prišlo do napake [3]. Obrnite se na svojo "
"tehnično službo."
msgstr "Error [3] deleting \"[2]\" file. Contact your support personnel."
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.Error-2.idtx:11 ..\MSI/Sl.DebugU.x64.Error-2.idtx:11
#: ..\MSI/Sl.ReleaseU.Win32.Error-2.idtx:11
#: ..\MSI/Sl.ReleaseU.x64.Error-2.idtx:11
msgid ""
"Pri brisanju razporejenega opravila »[2]« je prišlo do napake [3]. Obrnite "
"se na svojo tehnično službo."
msgstr ""
"Error [3] deleting \"[2]\" scheduled task. Contact your support personnel."
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.Error-2.idtx:13 ..\MSI/Sl.DebugU.x64.Error-2.idtx:13
#: ..\MSI/Sl.ReleaseU.Win32.Error-2.idtx:13
#: ..\MSI/Sl.ReleaseU.x64.Error-2.idtx:13
msgid ""
"Pri kopiranju razporejenega opravila »[2]« v »[3]« je prišlo do napake [4]. "
"Obrnite se na svojo tehnično službo."
msgstr ""
"Error [4] copying \"[2]\" scheduled task to \"[3]\". Contact your support "
"personnel."
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.Error-2.idtx:7 ..\MSI/Sl.DebugU.x64.Error-2.idtx:7
msgid "Pri nastavljanju parametra »[2]« je prišlo do napake [3]."
msgstr "Error [3] setting \"[2]\" parameter."
#: ..\MSI/Sl.ReleaseU.Win32.Error-2.idtx:7
#: ..\MSI/Sl.ReleaseU.x64.Error-2.idtx:7
msgid ""
"Pri nastavljanju parametra »[2]« je prišlo do napake [3]. Obrnite se na "
"svojo tehnično službo."
msgstr "Error [3] setting \"[2]\" parameter. Contact your support personnel."
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.Error-2.idtx:12 ..\MSI/Sl.DebugU.x64.Error-2.idtx:12
#: ..\MSI/Sl.ReleaseU.Win32.Error-2.idtx:12
#: ..\MSI/Sl.ReleaseU.x64.Error-2.idtx:12
msgid ""
"Pri o(ne)mogočanju razporejenega opravila »[2]« je prišlo do napake [3]. "
"Obrnite se na svojo tehnično službo."
msgstr ""
"Error [3] enabling/disabling \"[2]\" scheduled task. Contact your support "
"personnel."
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.Error-2.idtx:4 ..\MSI/Sl.DebugU.x64.Error-2.idtx:4
msgid "Pri odpiranju namestitvenega paketa je prišlo do napake."
msgstr "Error opening installation package."
#: ..\MSI/Sl.ReleaseU.Win32.Error-2.idtx:4
#: ..\MSI/Sl.ReleaseU.x64.Error-2.idtx:4
msgid ""
"Pri odpiranju namestitvenega paketa je prišlo do napake. Obrnite se na svojo "
"tehnično službo."
msgstr "Error opening installation package. Contact your support personnel."
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.Error-2.idtx:6 ..\MSI/Sl.DebugU.x64.Error-2.idtx:6
#: ..\MSI/Sl.ReleaseU.Win32.Error-2.idtx:6
#: ..\MSI/Sl.ReleaseU.x64.Error-2.idtx:6
msgid ""
"Pri pisanju v datoteko seznama razporejenih opravil »[2]« je prišlo do "
"napake [3]."
msgstr "Error [3] writing to \"[2]\" scheduled task list file."
"napake [3]. Obrnite se na svojo tehnično službo."
msgstr ""
"Error [3] writing to \"[2]\" scheduled task list file. Contact your support "
"personnel."
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.Error-2.idtx:9 ..\MSI/Sl.DebugU.x64.Error-2.idtx:9
msgid "Pri premikanju datoteke »[2]« v »[3]« je prišlo do napake [4]."
msgstr "Error [4] moving \"[2]\" file to \"[3]\"."
#: ..\MSI/Sl.ReleaseU.Win32.Error-2.idtx:9
#: ..\MSI/Sl.ReleaseU.x64.Error-2.idtx:9
msgid ""
"Pri premikanju datoteke »[2]« v »[3]« je prišlo do napake [4]. Obrnite se na "
"svojo tehnično službo."
msgstr ""
"Error [4] moving \"[2]\" file to \"[3]\". Contact your support personnel."
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.Error-2.idtx:5 ..\MSI/Sl.DebugU.x64.Error-2.idtx:5
msgid "Pri pripravi seznama razvrščenih opravil je prišlo do napake [2]."
msgstr "Error [2] creating scheduled task list."
#: ..\MSI/Sl.ReleaseU.Win32.Error-2.idtx:5
#: ..\MSI/Sl.ReleaseU.x64.Error-2.idtx:5
msgid ""
"Pri pripravi seznama razvrščenih opravil je prišlo do napake [2]. Obrnite se "
"na svojo tehnično službo."
msgstr ""
"Error [2] creating scheduled task list. Contact your support personnel."
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.Error-2.idtx:10 ..\MSI/Sl.DebugU.x64.Error-2.idtx:10
#: ..\MSI/Sl.ReleaseU.Win32.Error-2.idtx:10
#: ..\MSI/Sl.ReleaseU.x64.Error-2.idtx:10
msgid ""
"Pri ustvarjanju razporejenega opravila »[2]« je prišlo do napake [3]. "
"Obrnite se na svojo tehnično službo."
msgstr ""
"Error [3] creating \"[2]\" scheduled task. Contact your support personnel."
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.ActionText-2.idtx:4
#: ..\MSI/Sl.DebugU.x64.ActionText-2.idtx:4
#: ..\MSI/Sl.ReleaseU.Win32.ActionText-2.idtx:4
#: ..\MSI/Sl.ReleaseU.x64.ActionText-2.idtx:4
msgid "Razporejeno opravilo: [1]"
msgstr "Scheduled task: [1]"
# !!! Lektorirati !!!
#: ..\MSI/Sl.DebugU.Win32.ActionText-2.idtx:4
#: ..\MSI/Sl.DebugU.x64.ActionText-2.idtx:4
#: ..\MSI/Sl.ReleaseU.Win32.ActionText-2.idtx:4
#: ..\MSI/Sl.ReleaseU.x64.ActionText-2.idtx:4
msgid "Registracija razporejenih opravil"
msgstr "Registering scheduled tasks"