From 15bbb82f06f8c5b0965cb42f8ddbbbb908113371 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 10 Jan 2013 09:31:09 +0000 Subject: [PATCH] Popravki, da se prevede tudi Release in Debug (ne-Unicode). --- MSITSCA.cpp | 18 +++++++++++++++--- MSITSCAOp.cpp | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/MSITSCA.cpp b/MSITSCA.cpp index 172b36e..440d75a 100644 --- a/MSITSCA.cpp +++ b/MSITSCA.cpp @@ -59,7 +59,7 @@ UINT MSITSCA_API EvaluateScheduledTasks(MSIHANDLE hInstall) // 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 : + _ttoi(sValue) || !sValue.IsEmpty() && _totlower(sValue.GetAt(0)) == _T('y') ? FALSE : TRUE : TRUE; olExecute.AddTail(new CMSITSCAOpRollbackEnable(bRollbackEnabled)); @@ -269,8 +269,20 @@ 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 CMSITSCAOpFileDelete(sSequenceFilenameRB)); - session.m_olRollback.AddTail(new CMSITSCAOpFileDelete(sSequenceFilenameCM)); + session.m_olCommit.AddTail(new CMSITSCAOpFileDelete( +#ifdef _UNICODE + sSequenceFilenameRB +#else + CStringW(sSequenceFilenameRB) +#endif + )); + session.m_olRollback.AddTail(new CMSITSCAOpFileDelete( +#ifdef _UNICODE + sSequenceFilenameCM +#else + CStringW(sSequenceFilenameCM) +#endif + )); // Save commit file first. hr = session.m_olCommit.SaveToFile(sSequenceFilenameCM); diff --git a/MSITSCAOp.cpp b/MSITSCAOp.cpp index 6aff504..07ab39c 100644 --- a/MSITSCAOp.cpp +++ b/MSITSCAOp.cpp @@ -802,7 +802,7 @@ HRESULT CMSITSCAOpTaskDelete::Execute(CMSITSCASession *pSession) TASK_LOGON_TYPE logonType; CComBSTR sSSDL; CComVariant vSSDL; - CString sDisplayNameOrig; + CStringW sDisplayNameOrig; UINT uiCount = 0; // Get the source task. @@ -887,7 +887,7 @@ HRESULT CMSITSCAOpTaskDelete::Execute(CMSITSCASession *pSession) if (pSession->m_bRollbackEnabled) { CComPtr pTask; DWORD dwFlags; - CString sDisplayNameOrig; + CStringW sDisplayNameOrig; UINT uiCount = 0; // Load the task.