1
Vote

Post build event of SevenZip2010 is not copying dll's to target folder if the folder is not created.

description

I guess we need to make sure the output directory to copy 7z.dll should be created automatically if it is existed.
 
i changed the post build event in my machine as follows.
@echo off
set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0
reg.exe Query %RegQry% > checkOS.txt
find /i "x86" < checkOS.txt >nul
 
if %ERRORLEVEL% == 0 ( goto 32bit ) else ( goto 64bit )
 
:32bit
echo Copying the 32-bit 7-Zip DLL...
mkdir "$(ProjectDir)..\SevenZipTest\bin\$(ConfigurationName)"
copy /B /Y "$(ProjectDir)7z.dll" "$(ProjectDir)..\SevenZipTest\bin\$(ConfigurationName)\7z.dll"
mkdir "$(ProjectDir)..\SevenZipTestWPF\bin\$(ConfigurationName)"
copy /B /Y "$(ProjectDir)7z.dll" "$(ProjectDir)..\SevenZipTestWPF\bin\$(ConfigurationName)\7z.dll"
goto exit
 
:64bit
echo Copying the 64-bit 7-Zip DLL...
mkdir "$(ProjectDir)..\SevenZipTest\bin\$(ConfigurationName)"
copy /B /Y "$(ProjectDir)7z64.dll" "$(ProjectDir)..\SevenZipTest\bin\$(ConfigurationName)\7z.dll"
mkdir "$(ProjectDir)..\SevenZipTestWPF\bin\$(ConfigurationName)"
copy /B /Y "$(ProjectDir)7z64.dll" "$(ProjectDir)..\SevenZipTestWPF\bin\$(ConfigurationName)\7z.dll"
goto exit
 
:exit
del /Q checkOS.txt
 
Please let me know whether it is required or not?

comments