I am creating a Windows Service in Visual Studio. On a post build event, I'd like to have 2 files created in the bin directory called install.bat and uninstall.bat. These files should have the name of the output EXE with a /u or /i in them. The name of the EXE should be dynamically written to the file, not hard coded. Is this possible?
Asked
Active
Viewed 5,155 times
1 Answers
7
Open the project properties, go to 'Build Events', click 'Edit Post-build ...' and make use of the provided 'Macros>>' to get the msbuild properties you're after. Something like this:
echo $(TargetFileName) /a > $(TargetDir)install.bat

stijn
- 34,664
- 13
- 111
- 163