Visual Studio 설치관리자 배포 : http://msdn.microsoft.com/ko-kr/library/vstudio/2kt85ked(v=vs.100).aspx

사용자 지정 작업 만들기 : http://msdn.microsoft.com/ko-kr/library/vstudio/d9k65z2d(v=vs.100).aspx

참고 : http://styletigger.tistory.com/21

 

 

추가 : http://msdn.microsoft.com/ko-kr/library/vstudio/d9k65z2d(v=vs.100).aspx

 

C++로 만드는 방법 : http://www.codeproject.com/Articles/335516/Custom-Action-in-Visual-Studio-setup-projects

http://msdn.microsoft.com/en-us/library/windows/desktop/aa370134(v=vs.85).aspx

 

 

UINT __stdcall MyCustomAction(MSIHANDLE hInstall)
{
    TCHAR* szValueBuf = NULL;
    DWORD cchValueBuf = 0;
    UINT uiStat =  MsiGetProperty(hInstall, TEXT("MyProperty"), TEXT(""), &cchValueBuf);
    //cchValueBuf now contains the size of the property's string, without null termination
    if (ERROR_MORE_DATA == uiStat)
    {
        ++cchValueBuf; // add 1 for null termination
        szValueBuf = new TCHAR[cchValueBuf];
        if (szValueBuf)
        {
            uiStat = MsiGetProperty(hInstall, TEXT("MyProperty"), szValueBuf, &cchValueBuf);
        }
    }
    if (ERROR_SUCCESS != uiStat)
    {
        if (szValueBuf != NULL)
           delete[] szValueBuf;
        return ERROR_INSTALL_FAILURE;
    }

    // custom action uses MyProperty
    // ...

    delete[] szValueBuf;

    return ERROR_SUCCESS;
}

저작자 표시 비영리 변경 금지
신고
posted by 뚱2