Sorry I send this to the e-mail address alone. it was asked for the
code.
Here we go:
Well if you insist ;-)
the code for the installer library
#include <windows.h>
// #include <strsafe.h>
#include <assert.h>
#include <msi.h>
#include <msiquery.h>
// #include <difxapi.h>
/* just for the DLL one might use a .def file instead */
#undef EXPORT
#define EXPORT __declspec(dllexport)

static void ShowSysErrMsg(DWORD err_code) {
        TCHAR buf[512];
        DWORD dw_rc;
        dw_rc = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
                                  NULL, err_code,
                                  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                         buf, sizeof(buf), NULL );
        if (dw_rc == 0) {
                MessageBox(NULL, TEXT("Could not get Error message from 
System"),
                           TEXT("FormatMessage failed"), MB_OK);
        } else {
                MessageBox(NULL, buf, TEXT("Error Message"), MB_OK 
|MB_ICONERROR);
        }
}



/* Helper function for printing to the setup.log file or the file
provieded on the command line like e.g
in msiexec /i some_msi_file.msi /* log_file_name.log
*/
static UINT InfoMessage(MSIHANDLE msiHandle, LPCTSTR msg) {
        MSIHANDLE hRecord = MsiCreateRecord(1);
        /* this magic one means that the record will just consist of
        one element in our case just some string */
        if (! hRecord) {
                MessageBox(NULL, L"Installer", L"Failed to create record", 
MB_OK |MB_ICONSTOP);
                return 0;
        }
        MessageBox(NULL, msg, TEXT("Installer message"), MB_OK);
        // MsiRecordSetString(hRecord, 0, msg);
        // MsiProcessMessage(msiHandle, INSTALLMESSAGE_INFO, hRecord);
        MsiCloseHandle(hRecord);
        return ERROR_SUCCESS;
}



UINT EXPORT __stdcall Install(MSIHANDLE msiHandle){
        InfoMessage(msiHandle, L"Just some text");
        return ERROR_SUCCESS;
}


the wxs file

a bit messy because of all the tries to get that installed
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi";>
  <Product Id="{05D5A26B-0131-416f-81A6-DC813BA3696A}"
           UpgradeCode="{1620D10A-CA26-47fe-AFBE-49CC218D21F8}"
           Name="Test Installer" Version="1.0.0"
           Manufacturer="Q-Software Solutions" Language="1033">
    <Package Id="{22D82036-AEBE-4042-A338-94FA33EE49DB}"
             Manufacturer="Q-Software Solutions GmbH"
             InstallerVersion="300" Platforms="Intel" Languages="1033"
             Compressed="yes" SummaryCodepage="1252" />

    <Media Id="1" EmbedCab="yes" Cabinet="SafeFax.cab" />

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id='ProgramFilesFolder' Name='PFiles'>
        <Directory Id='qss_test' Name='QSSTest' LongName='QSS Test'>
          <Component Id="c_dummy"
                      Guid="{A631B84A-7D5A-4580-9DAB-F7C759DC0C87}">

            <File Id="README" Name="README" LongName="README"
                Vital="yes" KeyPath="yes" DiskId="1"
                Source="README"/>


          </Component>
          <!--
<Component Id="msvc8_libs"
           Guid="{A61A830F-3AB6-4568-A61A-0BCF2E443008}">

        <File Id="vc8_manifest" Name="vc8_1" 
LongName="Microsoft.VC80.CRT.manifest"
              Source="Microsoft.VC80.CRT.manifest"
              DiskId="1" />

        <File Id="msvcm80.dll" Name="vc8_2" LongName="msvcm80.dll"
              Source="msvcm80.dll"
              DiskId="1" />

        <File Id="msvcp80.dll" Name="vc8_3" LongName="msvcp80.dll"
              Source="msvcp80.dll"
              DiskId="1" />


        <File Id="msvcr80.dll" Name="vc8_2" LongName="msvcr80.dll"
              Source="msvcr80.dll"
              DiskId="1" />
-->




         
<!--          
          <Merge Id="vc8_runtime_policy"
                 Language="1033"
                 SourceFile="V:\Program Files\Common Files\Merge 
Modules\policy_8_0_Microsoft_VC80_CRT_x86.msm"
                 
                 DiskId="1" />
          <Merge Id="vc8_runtime"
                 Language="1033"
                 SourceFile="V:\Program Files\Common Files\Merge 
Modules\Microsoft_VC80_CRT_x86.msm"
                 DiskId="1" />
                 -->


        </Directory>
      </Directory>
    </Directory>

    <Feature Id="DefaultFeature" Level="1" ConfigurableDirectory="TARGETDIR">
      <ComponentRef Id="c_dummy" />
<!--
<ComponentRef Id="msvc8_libs" />

      <MergeRef Id="vc8_runtime_policy" />
      <MergeRef Id="vc8_runtime" />
      -->
      
    </Feature>

    <InstallExecuteSequence>
      <Custom Action='ca_c1' After='InstallFiles'/>
    </InstallExecuteSequence>

    <Binary Id='ca_c1_dll' SourceFile='t2.dll' />
    <CustomAction Id='ca_c1' BinaryKey='ca_c1_dll' DllEntry='[EMAIL PROTECTED]' 
/>

  </Product>
</Wix>

the marvellous README 
Just a dummy file
Not of any use.


Ah yes just to mention it. I have linked the library later statically
and "of course" that has worked.... 

Howerver I really would like to understand this kind of "stuff". 

System is Vista 32-bit (shame one me ;( )

Regards
Friedrich

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to