AleXelton
AleXelton

Reputation: 772

How to execute process before build multiple projects in a solution

I'm using VS2010 on Windows 7 Ultimate x64. I want to build multi-project in one solution automatically.

For example : ) Solution StormSolution contains 4 projects.

1 : Storm_Module1 (output file extension : dll)

2 : Storm_Module2 (output file extension : dll)

3 : CombineModule12 (output file extension : dat)

4 : ConvertModule2CFGFile (output file extension : cfg)

Step 1,2 : A result of Storm_Module1 and Storm_Module2 are Standard Windows DLL.

Step 3 : A result of CombineModule12 is open Storm_Module1.dll and Storm_Module2.dll to make "combined.dat" file, like cmd.exe /c copy /b storm_module1.dll + storm_module2.dll combined.dat command.

Step 3-1 : Then, make combined.dat file into encrypted_combined.dat file with encryption_tool.

Step 4 : Open "encrypted_combined.dat" file and make it into own specified cfg file.

The problem occurs on Step 4. I can't build solution storm automatically. Because I've to make "combined.dat" result of Step3 into "encrypted_combined.dat" with encryption_tool.

So, if I build Storm solution without any action, ConvertModule2CFGFile project can not open latest updated encrypted_combined.dat.

How can I execute encryption tool before on Step4.

Encryption tool can be executed with parameters.

ex:) cmd.exe /c "encryption tool.exe -mode_crypt combined.dat -output encrypted_combined.dat.

Is it impossible to execute process before build project?

Upvotes: 0

Views: 418

Answers (2)

Freakyy
Freakyy

Reputation: 365

In Visual Studio you can create Post-Build Events which can execute a batch file. Use that to combine your two DLLs.

To make your projects build in the correct order, adjust Build Dependencies and Build Order in your Solution/Projects.

Upvotes: 1

KjMag
KjMag

Reputation: 2780

Consider writing a batch file for Visual Studio Command Prompt - it will enable you to build solutions 1 & 2 first, then you can perform any operation on files you like and call your encryption tool easily, and then build the last solution.

This thread should get you started:

How to create a Batch File for Visual Studio Command Prompt

Upvotes: 0

Related Questions