-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add batch file and .py script to make UIforETW releases.
package_etw.bat makes a self-contained .zip file that can be used as a non-source release of UIforETW. It uses make_zip_file.py, and there are also a few .gitignore exclusions to make it run smoothly.
- Loading branch information
1 parent
987004b
commit 65cfc3a
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,7 @@ present.txt | |
|
||
# wpaexporter drops these | ||
*.csv | ||
|
||
#Created by package_etw.bat | ||
etwpackage/ | ||
etwpackage.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import sys | ||
import os | ||
import zipfile | ||
|
||
if len(sys.argv) < 3: | ||
print "Usage: %s zipfile directory" % sys.argv[0] | ||
sys.exit(0) | ||
|
||
filename = sys.argv[1] | ||
dirToZip = sys.argv[2] | ||
|
||
# Change to the specified directory so that relative paths are added instead | ||
# of absolute paths. | ||
os.chdir(dirToZip) | ||
dirToZip = "." | ||
|
||
# Request compression | ||
zf = zipfile.ZipFile(filename, "w", zipfile.ZIP_DEFLATED) | ||
for dirname, subdirs, files in os.walk(dirToZip): | ||
zf.write(dirname) | ||
for filename in files: | ||
filePath = os.path.join(dirname, filename) | ||
zf.write(filePath) | ||
zf.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
@setlocal | ||
|
||
@echo Creating a package of files for easy use of ETW/WPT. | ||
|
||
set UIforETW=%~dp0 | ||
set destdir=%~dp0etwpackage | ||
|
||
rmdir %destdir% /s/q | ||
@if exist %destdir%\bin\UIforETW.exe goto pleasecloseUIforETW | ||
@if exist %destdir%\bin\ETWProviders.dll goto pleasecloseSomething | ||
mkdir %destdir%\bin | ||
mkdir %destdir%\include | ||
mkdir %destdir%\lib | ||
mkdir %destdir%\third_party | ||
|
||
@rem Add VS tools to the path | ||
@call "%vs120comntools%vsvars32.bat" | ||
|
||
cd /d %UIforETW% | ||
cd UIforETW | ||
@rem Modify the UIforETW project to be statically linked and build that version | ||
@rem so that it will run without any extra install requirements. | ||
sed "s/UseOfMfc>Dynamic/UseOfMfc>Static/" <UIforETW.vcxproj >UIforETWStatic.vcxproj | ||
sed "s/UIforETW.vcxproj/UIforETWStatic.vcxproj/" <UIforETW.sln >UIforETWStatic.sln | ||
rmdir Release /s/q | ||
rmdir x64\Release /s/q | ||
devenv /rebuild "release|Win32" UIforETWStatic.sln | ||
devenv /rebuild "release|x64" UIforETWStatic.sln | ||
@rem Clean up after building the static version. | ||
rmdir Release /s/q | ||
rmdir x64\Release /s/q | ||
del UIforETWStatic.vcxproj | ||
del UIforETWStatic.sln | ||
|
||
xcopy %UIforETW%\bin %destdir%\bin /s | ||
del %destdir%\bin\*.lastcodeanalysissucceeded | ||
del %destdir%\bin\*.pdb | ||
xcopy %UIforETW%\include %destdir%\include /s | ||
xcopy %UIforETW%\lib %destdir%\lib /s | ||
xcopy %UIforETW%\third_party %destdir%\third_party /s | ||
del %destdir%\bin\.gitignore | ||
del %destdir%\bin\UIforETW*_dev*.* | ||
@rem Get the destinations to exist so that the xcopy proceeds without a question. | ||
echo >%destdir%\bin\UIforETW.exe | ||
echo >%destdir%\bin\UIforETW32.exe | ||
xcopy %UIforETW%\bin\UIforETWStatic_devrel32.exe %destdir%\bin\UIforETW32.exe /y | ||
xcopy %UIforETW%\bin\UIforETWStatic_devrel.exe %destdir%\bin\UIforETW.exe /y | ||
|
||
python %UIforETW%make_zip_file.py %UIforETW%etwpackage.zip %destdir% | ||
|
||
@echo Now upload the new etwpackage.zip | ||
@exit /b | ||
|
||
:pleasecloseUIforETW | ||
@echo UIforETW is running. Please close it and try again. | ||
@exit /b | ||
|
||
:pleasecloseSomething | ||
@echo Something is running with ETWProviders.dll loaded. Please close it and try again. | ||
@exit /b |