MakeSfxCA and project output

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

MakeSfxCA and project output

Shawn Dwyer
Hi,

Is there a way to get MakeSfxCA include everything in my CA project ouput
directory recursively, maintaining folder structure?  It seems to me this
would be the simplest way of ensuring all necessary dependencies are there
at runtime.

For a simple example say I have my EULAs for each language in a subdirectory
such as $(TargetDir)\EULAs\ja-JP\Eula.rtf.  I'd like this file and the
folder structure to be there at runtime.

Of course in the above example I could simply flatten the folder structure
and add the language as part of the file name, but my particular scenario is
more complicated.

Another example would be to get the dependencies of dependencies.  For
example Project A depends on Project B which depends on Project C.  The
output of C is automatically copied to the output directory of B, and all of
that to the ouput directory of A.  I'd like to someout get that all packaged
up and available at runtime.

Thanks,

Shawn
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: MakeSfxCA and project output

Shawn Dwyer
I think I'm getting close but I'm getting an error when unpacking.

Reading the source for MakeSfxCA I found the GetPackFileMap function and
reading the description:  "By default, all files will be placed in the root
of the cab. But inputs may optionally include an alternate inside-cab file
path before an equals sign."

So this implied to me that on the MakeSfxCA command line, rather than pass "
$(TargetDir)EULAs\ja-JP\Eula.rtf" I could pass "EULAs\en-US\Eula.rtf=
$(TargetDir)EULAs\ja-JP\Eula.rtf"

I beleive the log output of MakeSfxCA confirmed this:
Packaging files
        MyInstallerCA.dll
        CustomAction.config
        Microsoft.Deployment.WindowsInstaller.dll
        EULAs\ja-JP\Eula.rtf

However, when I run my installer I get the following error:

SFXCA: Extracting custom action to temporary directory: Temp\MSI28AD.tmp-\
MSI (c) (D0!6C) [23:20:00:013]: Closing MSIHANDLE (2) of type 790531 for
thread 3436
MSI (c) (D0!6C) [23:20:00:091]: Creating MSIHANDLE (3) of type 790531 for
thread 3436
*SFXCA: Failed to extract to temporary directory. Cabinet error code 11.*

Has anyone tried this before and gotten it to work?  Is there a better way
to do this?


Additionally I figured out how to pack everything in my CA project ouput
directory recursively.  I replaced the PackCustomAction taget in the
Wix.CA.targets file with the following.  I don't recommend changing this
file since it will get overwritten on the next Wix install, I simply did
this as a shortcut to see if I could get it to work.  This could be placed
in any project file or imported from a custom target though.

<Target Name="AfterBuild">

        <CreateProperty Value="$(TargetDir)$(TargetCAFileName)">
                <Output TaskParameter="Value"
PropertyName="TargetCAPackage"/>
        </CreateProperty>

        <CreateItem Include="$(TargetDir)**\*.*">
                <Output TaskParameter="Include"
ItemName="AllFilesInTargetDir"  />
        </CreateItem>

        <CreateItem Include="@(AllFilesInTargetDir)"
                Condition=" '%(AllFilesInTargetDir.FullPath)' !=
'$(TargetPath)' and '%(AllFilesInTargetDir.FullPath)' !=
'$(TargetCAPackage)'" >
                <Output TaskParameter="Include"
ItemName="AllDependenciesInTargetDir"  />
        </CreateItem>

        <CreateProperty
Value="@(AllDependenciesInTargetDir->'%(RecursiveDir)%(Filename)%(Extension)=%(RecursiveDir)%(Filename)%(Extension)')"
>
                <Output TaskParameter="Value"
PropertyName="AllDependenciesInTargetDirList" />
        </CreateProperty>

        <!-- Run the MakeSfxCA.exe CA packaging tool. -->
        <Exec Command='"$(MakeSfxCA)" "$(TargetCAPackage)" "$(SfxCADll)"
"$(TargetPath)" "$(AllDependenciesInTargetDirList)"'
WorkingDirectory="$(TargetDir)" />

</Target>


On Wed, Feb 25, 2009 at 12:07 PM, Shawn Dwyer <[hidden email]>wrote:

> Hi,
>
> Is there a way to get MakeSfxCA include everything in my CA project ouput
> directory recursively, maintaining folder structure?  It seems to me this
> would be the simplest way of ensuring all necessary dependencies are there
> at runtime.
>
> For a simple example say I have my EULAs for each language in a
> subdirectory such as $(TargetDir)\EULAs\ja-JP\Eula.rtf.  I'd like this file
> and the folder structure to be there at runtime.
>
> Of course in the above example I could simply flatten the folder structure
> and add the language as part of the file name, but my particular scenario is
> more complicated.
>
> Another example would be to get the dependencies of dependencies.  For
> example Project A depends on Project B which depends on Project C.  The
> output of C is automatically copied to the output directory of B, and all of
> that to the ouput directory of A.  I'd like to someout get that all packaged
> up and available at runtime.
>
> Thanks,
>
> Shawn
>
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: MakeSfxCA and project output

Shawn Dwyer
Has anyone gotten this error when using DTF?SFXCA: Failed to extract to
temporary directory. Cabinet error code 11.

Has anyone managed to pack a directory using another method?

Thanks,

Shawn

On Thu, Feb 26, 2009 at 12:01 AM, Shawn Dwyer <[hidden email]>wrote:

> I think I'm getting close but I'm getting an error when unpacking.
>
> Reading the source for MakeSfxCA I found the GetPackFileMap function and
> reading the description:  "By default, all files will be placed in the
> root of the cab. But inputs may optionally include an alternate inside-cab
> file path before an equals sign."
>
> So this implied to me that on the MakeSfxCA command line, rather than pass
> "$(TargetDir)EULAs\ja-JP\Eula.rtf" I could pass "EULAs\ja-JP\Eula.rtf=
> $(TargetDir)EULAs\ja-JP\Eula.rtf"
>
> I beleive the log output of MakeSfxCA confirmed this:
> Packaging files
>         MyInstallerCA.dll
>         CustomAction.config
>         Microsoft.Deployment.WindowsInstaller.dll
>         EULAs\ja-JP\Eula.rtf
>
> However, when I run my installer I get the following error:
>
> SFXCA: Extracting custom action to temporary directory: Temp\MSI28AD.tmp-\
> MSI (c) (D0!6C) [23:20:00:013]: Closing MSIHANDLE (2) of type 790531 for
> thread 3436
> MSI (c) (D0!6C) [23:20:00:091]: Creating MSIHANDLE (3) of type 790531 for
> thread 3436
> *SFXCA: Failed to extract to temporary directory. Cabinet error code 11.*
>
> Has anyone tried this before and gotten it to work?  Is there a better way
> to do this?
>
>
> Additionally I figured out how to pack everything in my CA project ouput
> directory recursively.  I replaced the PackCustomAction taget in the
> Wix.CA.targets file with the following.  I don't recommend changing this
> file since it will get overwritten on the next Wix install, I simply did
> this as a shortcut to see if I could get it to work.  This could be placed
> in any project file or imported from a custom target though.
>
> <Target Name="AfterBuild">
>
>         <CreateProperty Value="$(TargetDir)$(TargetCAFileName)">
>                 <Output TaskParameter="Value"
> PropertyName="TargetCAPackage"/>
>         </CreateProperty>
>
>         <CreateItem Include="$(TargetDir)**\*.*">
>                 <Output TaskParameter="Include"
> ItemName="AllFilesInTargetDir"  />
>         </CreateItem>
>
>         <CreateItem Include="@(AllFilesInTargetDir)"
>                 Condition=" '%(AllFilesInTargetDir.FullPath)' !=
> '$(TargetPath)' and '%(AllFilesInTargetDir.FullPath)' !=
> '$(TargetCAPackage)'" >
>                 <Output TaskParameter="Include"
> ItemName="AllDependenciesInTargetDir"  />
>         </CreateItem>
>
>         <CreateProperty
> Value="@(AllDependenciesInTargetDir->'%(RecursiveDir)%(Filename)%(Extension)=%(RecursiveDir)%(Filename)%(Extension)')"
> >
>                 <Output TaskParameter="Value"
> PropertyName="AllDependenciesInTargetDirList" />
>         </CreateProperty>
>
>         <!-- Run the MakeSfxCA.exe CA packaging tool. -->
>         <Exec Command='"$(MakeSfxCA)" "$(TargetCAPackage)" "$(SfxCADll)"
> "$(TargetPath)" "$(AllDependenciesInTargetDirList)"'
> WorkingDirectory="$(TargetDir)" />
>
> </Target>
>
>
> On Wed, Feb 25, 2009 at 12:07 PM, Shawn Dwyer <[hidden email]>wrote:
>
>> Hi,
>>
>> Is there a way to get MakeSfxCA include everything in my CA project ouput
>> directory recursively, maintaining folder structure?  It seems to me this
>> would be the simplest way of ensuring all necessary dependencies are there
>> at runtime.
>>
>> For a simple example say I have my EULAs for each language in a
>> subdirectory such as $(TargetDir)\EULAs\ja-JP\Eula.rtf.  I'd like this file
>> and the folder structure to be there at runtime.
>>
>> Of course in the above example I could simply flatten the folder structure
>> and add the language as part of the file name, but my particular scenario is
>> more complicated.
>>
>> Another example would be to get the dependencies of dependencies.  For
>> example Project A depends on Project B which depends on Project C.  The
>> output of C is automatically copied to the output directory of B, and all of
>> that to the ouput directory of A.  I'd like to someout get that all packaged
>> up and available at runtime.
>>
>> Thanks,
>>
>> Shawn
>>
>
>
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: MakeSfxCA and project output

jnanneng
FDI Error code of 11 means user aborted; I found that interesting so I dug into this a bit...

sfxca\Extract.cpp :: ExtractCabinet
        Comments note that the destination directory (szExtractDir) must already exist (and should be empty)

sfxca\Extract.cpp :: FNFDINOTIFY...
        case fdintCOPY_FILE...

                pfdin->psz1 is the name of the file within the cabinet, including the 'folder name'. For this example, assume "Foo\File.txt" and the extraction directory is "C:\Extract"

                Then we get to this code...

1 size_t cchFile = MultiByteToWideChar(CP_UTF8, 0, pfdin->psz1, -1, NULL, 0);
2 size_t cchFilePath = wcslen(g_szExtractDir) + 1 + cchFile;
3 wchar_t* szFilePath = (wchar_t*) _alloca((cchFilePath + 1) * sizeof(wchar_t));
4 if (szFilePath == NULL) return -1;
5 StringCchCopyW(szFilePath, cchFilePath + 1, g_szExtractDir);
6 StringCchCatW(szFilePath, cchFilePath + 1, L"\\");
7 MultiByteToWideChar(CP_UTF8, 0, pfdin->psz1, -1,
8 szFilePath + cchFilePath - cchFile, (int) cchFile + 1);
9 int hf;
10 _wsopen__s(hf, szFilePath,
11 _O_BINARY | _O_CREAT | _O_WRONLY | _O_SEQUENTIAL,
12 _SH_DENYWR, _S_IREAD | _S_IWRITE);
13 return hf

szFilePath becomes C:\Extract\Foo\File.txt

Then the call to _wsopen__s (line 10) to that file path...well, the directory doesn't exist ('C:\Extract\Foo' [however 'c:\Extract' does]) and this function doesn't create it, so it returns failure and a -1 for "hf".  -1 then is returned (line 13) which in this context, means user abort.

Hence "SFXCA: Failed to extract to temporary directory. Cabinet error code 11." appears in the MSI log.




-----Original Message-----
From: Shawn Dwyer [mailto:[hidden email]]
Sent: Friday, February 27, 2009 12:07 AM
To: General discussion for Windows Installer XML toolset.; Shawn Dwyer
Subject: Re: [WiX-users] MakeSfxCA and project output

Has anyone gotten this error when using DTF?SFXCA: Failed to extract to
temporary directory. Cabinet error code 11.

Has anyone managed to pack a directory using another method?

Thanks,

Shawn

On Thu, Feb 26, 2009 at 12:01 AM, Shawn Dwyer <[hidden email]>wrote:

> I think I'm getting close but I'm getting an error when unpacking.
>
> Reading the source for MakeSfxCA I found the GetPackFileMap function and
> reading the description:  "By default, all files will be placed in the
> root of the cab. But inputs may optionally include an alternate inside-cab
> file path before an equals sign."
>
> So this implied to me that on the MakeSfxCA command line, rather than pass
> "$(TargetDir)EULAs\ja-JP\Eula.rtf" I could pass "EULAs\ja-JP\Eula.rtf=
> $(TargetDir)EULAs\ja-JP\Eula.rtf"
>
> I beleive the log output of MakeSfxCA confirmed this:
> Packaging files
>         MyInstallerCA.dll
>         CustomAction.config
>         Microsoft.Deployment.WindowsInstaller.dll
>         EULAs\ja-JP\Eula.rtf
>
> However, when I run my installer I get the following error:
>
> SFXCA: Extracting custom action to temporary directory: Temp\MSI28AD.tmp-\
> MSI (c) (D0!6C) [23:20:00:013]: Closing MSIHANDLE (2) of type 790531 for
> thread 3436
> MSI (c) (D0!6C) [23:20:00:091]: Creating MSIHANDLE (3) of type 790531 for
> thread 3436
> *SFXCA: Failed to extract to temporary directory. Cabinet error code 11.*
>
> Has anyone tried this before and gotten it to work?  Is there a better way
> to do this?
>
>
> Additionally I figured out how to pack everything in my CA project ouput
> directory recursively.  I replaced the PackCustomAction taget in the
> Wix.CA.targets file with the following.  I don't recommend changing this
> file since it will get overwritten on the next Wix install, I simply did
> this as a shortcut to see if I could get it to work.  This could be placed
> in any project file or imported from a custom target though.
>
> <Target Name="AfterBuild">
>
>         <CreateProperty Value="$(TargetDir)$(TargetCAFileName)">
>                 <Output TaskParameter="Value"
> PropertyName="TargetCAPackage"/>
>         </CreateProperty>
>
>         <CreateItem Include="$(TargetDir)**\*.*">
>                 <Output TaskParameter="Include"
> ItemName="AllFilesInTargetDir"  />
>         </CreateItem>
>
>         <CreateItem Include="@(AllFilesInTargetDir)"
>                 Condition=" '%(AllFilesInTargetDir.FullPath)' !=
> '$(TargetPath)' and '%(AllFilesInTargetDir.FullPath)' !=
> '$(TargetCAPackage)'" >
>                 <Output TaskParameter="Include"
> ItemName="AllDependenciesInTargetDir"  />
>         </CreateItem>
>
>         <CreateProperty
> Value="@(AllDependenciesInTargetDir->'%(RecursiveDir)%(Filename)%(Extension)=%(RecursiveDir)%(Filename)%(Extension)')"
> >
>                 <Output TaskParameter="Value"
> PropertyName="AllDependenciesInTargetDirList" />
>         </CreateProperty>
>
>         <!-- Run the MakeSfxCA.exe CA packaging tool. -->
>         <Exec Command='"$(MakeSfxCA)" "$(TargetCAPackage)" "$(SfxCADll)"
> "$(TargetPath)" "$(AllDependenciesInTargetDirList)"'
> WorkingDirectory="$(TargetDir)" />
>
> </Target>
>
>
> On Wed, Feb 25, 2009 at 12:07 PM, Shawn Dwyer <[hidden email]>wrote:
>
>> Hi,
>>
>> Is there a way to get MakeSfxCA include everything in my CA project ouput
>> directory recursively, maintaining folder structure?  It seems to me this
>> would be the simplest way of ensuring all necessary dependencies are there
>> at runtime.
>>
>> For a simple example say I have my EULAs for each language in a
>> subdirectory such as $(TargetDir)\EULAs\ja-JP\Eula.rtf.  I'd like this file
>> and the folder structure to be there at runtime.
>>
>> Of course in the above example I could simply flatten the folder structure
>> and add the language as part of the file name, but my particular scenario is
>> more complicated.
>>
>> Another example would be to get the dependencies of dependencies.  For
>> example Project A depends on Project B which depends on Project C.  The
>> output of C is automatically copied to the output directory of B, and all of
>> that to the ouput directory of A.  I'd like to someout get that all packaged
>> up and available at runtime.
>>
>> Thanks,
>>
>> Shawn
>>
>
>
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: MakeSfxCA and project output

Jason Ginchereau
Thanks John for the investigation, it wasn't obvious to me before what the root cause was. So... what this means is, SfxCA just doesn't support subdirectories in the CA package. Perhaps I should have documented that limitation but honestly I think it was an oversight in the implementation and testing.

If someone really needs that capability, please log a bug on sourceforge. I know the DTF bugs have been piling up a bit recently, but I hope to dedicate some time soon to getting those cleaned up.

-Jason-

-----Original Message-----
From: John Nannenga [mailto:[hidden email]]
Sent: Friday, February 27, 2009 8:57 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] MakeSfxCA and project output

FDI Error code of 11 means user aborted; I found that interesting so I dug into this a bit...

sfxca\Extract.cpp :: ExtractCabinet
        Comments note that the destination directory (szExtractDir) must already exist (and should be empty)

sfxca\Extract.cpp :: FNFDINOTIFY...
        case fdintCOPY_FILE...

                pfdin->psz1 is the name of the file within the cabinet, including the 'folder name'. For this example, assume "Foo\File.txt" and the extraction directory is "C:\Extract"

                Then we get to this code...

1 size_t cchFile = MultiByteToWideChar(CP_UTF8, 0, pfdin->psz1, -1, NULL, 0);
2 size_t cchFilePath = wcslen(g_szExtractDir) + 1 + cchFile;
3 wchar_t* szFilePath = (wchar_t*) _alloca((cchFilePath + 1) * sizeof(wchar_t));
4 if (szFilePath == NULL) return -1;
5 StringCchCopyW(szFilePath, cchFilePath + 1, g_szExtractDir);
6 StringCchCatW(szFilePath, cchFilePath + 1, L"\\");
7 MultiByteToWideChar(CP_UTF8, 0, pfdin->psz1, -1,
8 szFilePath + cchFilePath - cchFile, (int) cchFile + 1);
9 int hf;
10 _wsopen__s(hf, szFilePath,
11 _O_BINARY | _O_CREAT | _O_WRONLY | _O_SEQUENTIAL,
12 _SH_DENYWR, _S_IREAD | _S_IWRITE);
13 return hf

szFilePath becomes C:\Extract\Foo\File.txt

Then the call to _wsopen__s (line 10) to that file path...well, the directory doesn't exist ('C:\Extract\Foo' [however 'c:\Extract' does]) and this function doesn't create it, so it returns failure and a -1 for "hf".  -1 then is returned (line 13) which in this context, means user abort.

Hence "SFXCA: Failed to extract to temporary directory. Cabinet error code 11." appears in the MSI log.




-----Original Message-----
From: Shawn Dwyer [mailto:[hidden email]]
Sent: Friday, February 27, 2009 12:07 AM
To: General discussion for Windows Installer XML toolset.; Shawn Dwyer
Subject: Re: [WiX-users] MakeSfxCA and project output

Has anyone gotten this error when using DTF?SFXCA: Failed to extract to
temporary directory. Cabinet error code 11.

Has anyone managed to pack a directory using another method?

Thanks,

Shawn

On Thu, Feb 26, 2009 at 12:01 AM, Shawn Dwyer <[hidden email]>wrote:

> I think I'm getting close but I'm getting an error when unpacking.
>
> Reading the source for MakeSfxCA I found the GetPackFileMap function and
> reading the description:  "By default, all files will be placed in the
> root of the cab. But inputs may optionally include an alternate inside-cab
> file path before an equals sign."
>
> So this implied to me that on the MakeSfxCA command line, rather than pass
> "$(TargetDir)EULAs\ja-JP\Eula.rtf" I could pass "EULAs\ja-JP\Eula.rtf=
> $(TargetDir)EULAs\ja-JP\Eula.rtf"
>
> I beleive the log output of MakeSfxCA confirmed this:
> Packaging files
>         MyInstallerCA.dll
>         CustomAction.config
>         Microsoft.Deployment.WindowsInstaller.dll
>         EULAs\ja-JP\Eula.rtf
>
> However, when I run my installer I get the following error:
>
> SFXCA: Extracting custom action to temporary directory: Temp\MSI28AD.tmp-\
> MSI (c) (D0!6C) [23:20:00:013]: Closing MSIHANDLE (2) of type 790531 for
> thread 3436
> MSI (c) (D0!6C) [23:20:00:091]: Creating MSIHANDLE (3) of type 790531 for
> thread 3436
> *SFXCA: Failed to extract to temporary directory. Cabinet error code 11.*
>
> Has anyone tried this before and gotten it to work?  Is there a better way
> to do this?
>
>
> Additionally I figured out how to pack everything in my CA project ouput
> directory recursively.  I replaced the PackCustomAction taget in the
> Wix.CA.targets file with the following.  I don't recommend changing this
> file since it will get overwritten on the next Wix install, I simply did
> this as a shortcut to see if I could get it to work.  This could be placed
> in any project file or imported from a custom target though.
>
> <Target Name="AfterBuild">
>
>         <CreateProperty Value="$(TargetDir)$(TargetCAFileName)">
>                 <Output TaskParameter="Value"
> PropertyName="TargetCAPackage"/>
>         </CreateProperty>
>
>         <CreateItem Include="$(TargetDir)**\*.*">
>                 <Output TaskParameter="Include"
> ItemName="AllFilesInTargetDir"  />
>         </CreateItem>
>
>         <CreateItem Include="@(AllFilesInTargetDir)"
>                 Condition=" '%(AllFilesInTargetDir.FullPath)' !=
> '$(TargetPath)' and '%(AllFilesInTargetDir.FullPath)' !=
> '$(TargetCAPackage)'" >
>                 <Output TaskParameter="Include"
> ItemName="AllDependenciesInTargetDir"  />
>         </CreateItem>
>
>         <CreateProperty
> Value="@(AllDependenciesInTargetDir->'%(RecursiveDir)%(Filename)%(Extension)=%(RecursiveDir)%(Filename)%(Extension)')"
> >
>                 <Output TaskParameter="Value"
> PropertyName="AllDependenciesInTargetDirList" />
>         </CreateProperty>
>
>         <!-- Run the MakeSfxCA.exe CA packaging tool. -->
>         <Exec Command='"$(MakeSfxCA)" "$(TargetCAPackage)" "$(SfxCADll)"
> "$(TargetPath)" "$(AllDependenciesInTargetDirList)"'
> WorkingDirectory="$(TargetDir)" />
>
> </Target>
>
>
> On Wed, Feb 25, 2009 at 12:07 PM, Shawn Dwyer <[hidden email]>wrote:
>
>> Hi,
>>
>> Is there a way to get MakeSfxCA include everything in my CA project ouput
>> directory recursively, maintaining folder structure?  It seems to me this
>> would be the simplest way of ensuring all necessary dependencies are there
>> at runtime.
>>
>> For a simple example say I have my EULAs for each language in a
>> subdirectory such as $(TargetDir)\EULAs\ja-JP\Eula.rtf.  I'd like this file
>> and the folder structure to be there at runtime.
>>
>> Of course in the above example I could simply flatten the folder structure
>> and add the language as part of the file name, but my particular scenario is
>> more complicated.
>>
>> Another example would be to get the dependencies of dependencies.  For
>> example Project A depends on Project B which depends on Project C.  The
>> output of C is automatically copied to the output directory of B, and all of
>> that to the ouput directory of A.  I'd like to someout get that all packaged
>> up and available at runtime.
>>
>> Thanks,
>>
>> Shawn
>>
>
>
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: MakeSfxCA and project output

Shawn Dwyer
Thanks John for looking into this and figuring out what was going on.
 Thanks Jason for confirming this was an oversight and not by design.  I've
fixed the issue in my local environment and unit tested on XP and Japanese
XP.  I submitted bug
2647864<http://sourceforge.net/tracker/index.php?func=detail&aid=2647864&group_id=105970&atid=642714>
and
attached to it the code to fix this issue.

I've also submitted a feature request to change Wix.CA.targets so that it
passes everything in the CA project output directory, recursively, to
MakeSfxCA.  The targets file to do this is attached to the feature request
2647918<http://sourceforge.net/tracker/index.php?func=detail&aid=2647918&group_id=105970&atid=642717>


Thanks again,

Shawn

On Fri, Feb 27, 2009 at 6:33 PM, Jason Ginchereau <[hidden email]>wrote:

> Thanks John for the investigation, it wasn't obvious to me before what the
> root cause was. So... what this means is, SfxCA just doesn't support
> subdirectories in the CA package. Perhaps I should have documented that
> limitation but honestly I think it was an oversight in the implementation
> and testing.
>
> If someone really needs that capability, please log a bug on sourceforge. I
> know the DTF bugs have been piling up a bit recently, but I hope to dedicate
> some time soon to getting those cleaned up.
>
> -Jason-
>
> -----Original Message-----
> From: John Nannenga [mailto:[hidden email]]
> Sent: Friday, February 27, 2009 8:57 AM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] MakeSfxCA and project output
>
> FDI Error code of 11 means user aborted; I found that interesting so I dug
> into this a bit...
>
> sfxca\Extract.cpp :: ExtractCabinet
>        Comments note that the destination directory (szExtractDir) must
> already exist (and should be empty)
>
> sfxca\Extract.cpp :: FNFDINOTIFY...
>        case    fdintCOPY_FILE...
>
>                pfdin->psz1 is the name of the file within the cabinet,
> including the 'folder name'. For this example, assume "Foo\File.txt" and the
> extraction directory is "C:\Extract"
>
>                Then we get to this code...
>
> 1               size_t cchFile = MultiByteToWideChar(CP_UTF8, 0,
> pfdin->psz1, -1, NULL, 0);
> 2               size_t cchFilePath = wcslen(g_szExtractDir) + 1 + cchFile;
> 3               wchar_t* szFilePath = (wchar_t*) _alloca((cchFilePath + 1)
> * sizeof(wchar_t));
> 4               if (szFilePath == NULL) return -1;
> 5               StringCchCopyW(szFilePath, cchFilePath + 1,
> g_szExtractDir);
> 6               StringCchCatW(szFilePath, cchFilePath + 1, L"\\");
> 7               MultiByteToWideChar(CP_UTF8, 0, pfdin->psz1, -1,
> 8                       szFilePath + cchFilePath - cchFile, (int) cchFile +
> 1);
> 9               int hf;
> 10              _wsopen__s(hf, szFilePath,
> 11                      _O_BINARY | _O_CREAT | _O_WRONLY | _O_SEQUENTIAL,
> 12                      _SH_DENYWR, _S_IREAD | _S_IWRITE);
> 13              return hf
>
> szFilePath becomes C:\Extract\Foo\File.txt
>
> Then the call to _wsopen__s (line 10) to that file path...well, the
> directory doesn't exist ('C:\Extract\Foo' [however 'c:\Extract' does]) and
> this function doesn't create it, so it returns failure and a -1 for "hf".
>  -1 then is returned (line 13) which in this context, means user abort.
>
> Hence "SFXCA: Failed to extract to temporary directory. Cabinet error code
> 11." appears in the MSI log.
>
>
>
>
> -----Original Message-----
> From: Shawn Dwyer [mailto:[hidden email]]
> Sent: Friday, February 27, 2009 12:07 AM
> To: General discussion for Windows Installer XML toolset.; Shawn Dwyer
> Subject: Re: [WiX-users] MakeSfxCA and project output
>
> Has anyone gotten this error when using DTF?SFXCA: Failed to extract to
> temporary directory. Cabinet error code 11.
>
> Has anyone managed to pack a directory using another method?
>
> Thanks,
>
> Shawn
>
> On Thu, Feb 26, 2009 at 12:01 AM, Shawn Dwyer <[hidden email]
> >wrote:
>
> > I think I'm getting close but I'm getting an error when unpacking.
> >
> > Reading the source for MakeSfxCA I found the GetPackFileMap function and
> > reading the description:  "By default, all files will be placed in the
> > root of the cab. But inputs may optionally include an alternate
> inside-cab
> > file path before an equals sign."
> >
> > So this implied to me that on the MakeSfxCA command line, rather than
> pass
> > "$(TargetDir)EULAs\ja-JP\Eula.rtf" I could pass "EULAs\ja-JP\Eula.rtf=
> > $(TargetDir)EULAs\ja-JP\Eula.rtf"
> >
> > I beleive the log output of MakeSfxCA confirmed this:
> > Packaging files
> >         MyInstallerCA.dll
> >         CustomAction.config
> >         Microsoft.Deployment.WindowsInstaller.dll
> >         EULAs\ja-JP\Eula.rtf
> >
> > However, when I run my installer I get the following error:
> >
> > SFXCA: Extracting custom action to temporary directory:
> Temp\MSI28AD.tmp-\
> > MSI (c) (D0!6C) [23:20:00:013]: Closing MSIHANDLE (2) of type 790531 for
> > thread 3436
> > MSI (c) (D0!6C) [23:20:00:091]: Creating MSIHANDLE (3) of type 790531 for
> > thread 3436
> > *SFXCA: Failed to extract to temporary directory. Cabinet error code 11.*
> >
> > Has anyone tried this before and gotten it to work?  Is there a better
> way
> > to do this?
> >
> >
> > Additionally I figured out how to pack everything in my CA project ouput
> > directory recursively.  I replaced the PackCustomAction taget in the
> > Wix.CA.targets file with the following.  I don't recommend changing this
> > file since it will get overwritten on the next Wix install, I simply did
> > this as a shortcut to see if I could get it to work.  This could be
> placed
> > in any project file or imported from a custom target though.
> >
> > <Target Name="AfterBuild">
> >
> >         <CreateProperty Value="$(TargetDir)$(TargetCAFileName)">
> >                 <Output TaskParameter="Value"
> > PropertyName="TargetCAPackage"/>
> >         </CreateProperty>
> >
> >         <CreateItem Include="$(TargetDir)**\*.*">
> >                 <Output TaskParameter="Include"
> > ItemName="AllFilesInTargetDir"  />
> >         </CreateItem>
> >
> >         <CreateItem Include="@(AllFilesInTargetDir)"
> >                 Condition=" '%(AllFilesInTargetDir.FullPath)' !=
> > '$(TargetPath)' and '%(AllFilesInTargetDir.FullPath)' !=
> > '$(TargetCAPackage)'" >
> >                 <Output TaskParameter="Include"
> > ItemName="AllDependenciesInTargetDir"  />
> >         </CreateItem>
> >
> >         <CreateProperty
> >
> Value="@(AllDependenciesInTargetDir->'%(RecursiveDir)%(Filename)%(Extension)=%(RecursiveDir)%(Filename)%(Extension)')"
> > >
> >                 <Output TaskParameter="Value"
> > PropertyName="AllDependenciesInTargetDirList" />
> >         </CreateProperty>
> >
> >         <!-- Run the MakeSfxCA.exe CA packaging tool. -->
> >         <Exec Command='"$(MakeSfxCA)" "$(TargetCAPackage)" "$(SfxCADll)"
> > "$(TargetPath)" "$(AllDependenciesInTargetDirList)"'
> > WorkingDirectory="$(TargetDir)" />
> >
> > </Target>
> >
> >
> > On Wed, Feb 25, 2009 at 12:07 PM, Shawn Dwyer <[hidden email]
> >wrote:
> >
> >> Hi,
> >>
> >> Is there a way to get MakeSfxCA include everything in my CA project
> ouput
> >> directory recursively, maintaining folder structure?  It seems to me
> this
> >> would be the simplest way of ensuring all necessary dependencies are
> there
> >> at runtime.
> >>
> >> For a simple example say I have my EULAs for each language in a
> >> subdirectory such as $(TargetDir)\EULAs\ja-JP\Eula.rtf.  I'd like this
> file
> >> and the folder structure to be there at runtime.
> >>
> >> Of course in the above example I could simply flatten the folder
> structure
> >> and add the language as part of the file name, but my particular
> scenario is
> >> more complicated.
> >>
> >> Another example would be to get the dependencies of dependencies.  For
> >> example Project A depends on Project B which depends on Project C.  The
> >> output of C is automatically copied to the output directory of B, and
> all of
> >> that to the ouput directory of A.  I'd like to someout get that all
> packaged
> >> up and available at runtime.
> >>
> >> Thanks,
> >>
> >> Shawn
> >>
> >
> >
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
> CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the
> Enterprise
> -Strategies to boost innovation and cut costs with open source
> participation
> -Receive a $600 discount off the registration fee with the source code:
> SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
> CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the
> Enterprise
> -Strategies to boost innovation and cut costs with open source
> participation
> -Receive a $600 discount off the registration fee with the source code:
> SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
> CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the
> Enterprise
> -Strategies to boost innovation and cut costs with open source
> participation
> -Receive a $600 discount off the registration fee with the source code:
> SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users