[Solved]Help making a VC++2005 express wizard

Started by
4 comments, last by kingpinzs 16 years, 9 months ago
sence there is no custome wizard in vc++2005 express how can I make my own wizard from scratch and install it into vc++2005 express? edit: Well after long hours and alot of experminting here is what I got This is a post on how to make your own wizard in viseule c++ 2005 express. I started this a couple of days ago and read a few things on-line that showed me were to start looking to do this. I did not find one that gave step by step instructions on how to do it. 1) is to make a project or projects that you want to have for your base code. Save only the CPP and H files in a file that we will be using to make the wizard //////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// HINT: The easy way out but you can only change the files there with your files but have the exact same names C:\Program Files\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\Application\templates\1033 and replace the root files with your files and choose win32 -> console app have the pdk installed for windows Edit the corewin_express.vsprops file C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults Change the string that reads: AdditionalDependencies="kernel32.lib" to AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib" you need to edit the file AppSettings.htm file located in the folder “%ProgramFiles%\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\Application\html\1033\". In a text editor comment out lines 441 - 444 by putting a // in front of them as shown here: // WIN_APP.disabled = true; // WIN_APP_LABEL.disabled = true; // DLL_APP.disabled = true; // DLL_APP_LABEL.disabled = true; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2)Create the file structure were you will be dumping your files C:\Program Files\Microsoft Visual Studio 8\VC\VCWizards\”your wizard folder” inside HTML\1033 Images Scripts\1033 Templates\1033 3)goto this location C:\Program Files\Microsoft Visual Studio 8\VC\Express\VCProjects and dump in 2 files “wizard”.vsz “wizard”.ico 4) edit your .vsz VSWIZARD 7.0 Wizard=VsWizard.VsWizardEngine.8.0 Param="WIZARD_NAME = Gwin32" change only Gwin32 to what ever yours is called 5) Depending were you want your wizard to show in the project picker window. You will need to goto 1 of 3 folders General VCNet Win32 I chose General so when you open the wizard mine will be under general now edit general.vsdir ..\”wizard”.vsz|{1B027A40-8F43-11D0-8D11-00A0C91BC942} |”gWin32 Wizard”|1|”To make a non MFC basic window.”|{1B027A40-8F43-11D0-8D11-00A0C91BC942} |0|4096|#1154 edit only what is in quotes then remove the quotes Ok that will be all for in there. Now for the hard part. NOTE: Only place we will be working in now is C:\Program Files\Microsoft Visual Studio 8\VC\VCWizards\”wizard” Your wizard folder. Starting with the first folder and working our way down HTML\1033 you will have two files AppSettings.htm default.htm I will attach my sample files to this post but I will post what you need to change to make it work for you. This is the default.htm the first page you will see when you start your wizard. It lest you crate your project with only the default settings NOTE: you will need to know a little html and java script to edit these files

	<SYMBOL NAME="WIN_APP" TYPE=checkbox VALUE=true></SYMBOL> //this is for the radio button
	<SYMBOL NAME="GAME_APP" TYPE=checkbox VALUE=false></SYMBOL> //these are for the check boxes
	<SYMBOL NAME="DEBUG_APP" TYPE=checkbox VALUE=false></SYMBOL>
	<SYMBOL NAME="DIRECT_3D_APP" TYPE=checkbox VALUE=false></SYMBOL>


//you can change this to have it say what ever you want 
<TD VALIGN="TOP" HEIGHT="65">
		&lt;H4 CLASS="HEAD" ID="HEAD"&gt;Welcome to the Win32 Game Application Wizard</H4>
		&lt;P CLASS="SUBHEAD" ID="SUBHEAD"&gt;This wizard generates a Win32 application project. The project can be a Windows application, a Game Loop, a Debug, or Direct 3D.</P>
	   &lt;/TD&gt;

//also this

&lt;SPAN CLASS="ACTIVELINK" ID="AppSettings" TITLE="Specify the type of application you will build with this project and the options or libraries you want supported." onClick="Next(document, 'AppSettings.htm');" TABINDEX="1"&gt;Application Settings&lt;/SPAN&gt;


&lt;SPAN CLASS="ItemTextTop" ID="PROJECT_SETTINGS_SPAN"&gt;These are the current project settings:&lt;/SPAN&gt;

&lt;SPAN CLASS="ItemText" ID="FinishText"&gt;Click Finish from any window to accept the current settings.&lt;/SPAN&gt;


&lt;SPAN CLASS="ItemText" ID="README_REMINDER" TITLE=""&gt;After you create the project, see the project's readme.txt file for information about the project features and files that are generated.&lt;/SPAN&gt;

//the meet of the file

function InitDocument(document)
{
	setDirection();
	
	if (window.external.FindSymbol("DOCUMENT_FIRST_LOAD"))
	{
		if("true" == window.external.FindSymbol("Windows_TYPE_ONLY"))
		{
				window.external.AddSymbol("WIN_APP", true);
		}
		var L_WizardDialogTitle_Text = "Win32 Game Application Wizard";
		window.external.AddSymbol("WIZARD_DIALOG_TITLE", L_WizardDialogTitle_Text);
		var strProjName = window.external.FindSymbol("PROJECT_NAME");
		var coll = document.all.tags("SYMBOL");
		var numSymbols = coll.length;
		for (i = 0; i &lt; numSymbols; i++)
		{
			var obj = coll(i);
			if (typeof(obj.VALUE) == "undefined")
			{
				obj.VALUE = getval(obj, strProjName);
			}
		}
		SetLocaleForResources(window.external.GetHostLocale());
		window.external.SetDefaults(document);
	}
	window.external.Load(document);
	InitControls();
}

function InitControls()
{
	var L_APPTYPEWIN_TEXT = "Windows App";
	var L_APPTYPEDLL_TEXT = "Game Loop";
	var L_APPTYPECON_TEXT = "Debug";
	var L_APPTYPELIB_TEXT = "Direct 3D";
	
	if (window.external.FindSymbol("GAME_APP"))
		APPTYPE.innerText = L_APPTYPEDLL_TEXT;
	else
	{
		if (window.external.FindSymbol("DEBUG_APP"))
			APPTYPE.innerText = L_APPTYPECON_TEXT;
		else
		{
			if (window.external.FindSymbol("DIRECT_3D_APP"))
				APPTYPE.innerText = L_APPTYPELIB_TEXT;
			else
				APPTYPE.innerText = L_APPTYPEWIN_TEXT;
		}
	}
}


This is for the AppSettings.htm make sure this path is correct

&lt;LINK ID="LINKURL" REL="stylesheet" HREF="../../../1033/Newstyles.css"&gt;

Also make sure this file is in your images folder. You can make a and name it what ever you want aslong as it coorspondes here and is about the same size

   &lt;TD CLASS="IMAGE" VALIGN="BOTTOM" WIDTH="110" ROWSPAN="2"&gt;
		&lt;DIV CLASS="SMALLA" ID="WIN_APP_IMAGE" style="DISPLAY:BLOCK;"&gt;
             <IMG CLASS="SMALL" SRC="..\..\Images\WindowsApp.gif" ALT="" BORDER="0"></DIV>


Make sure the spacer.gif is in your images folder also and it and the above image can be taken from one of the other image folders for the other wizards this is for your major application types that appear as radio button on the wizard so you can choose it or another major app type but not both and as long as you note the ID and make sure every thing coorsponds you can have as many as you want

&lt;INPUT TYPE="radio" CLASS="Radio" onPropertyChange="InitControls();" NAME="apptype" ID="WIN_APP" ACCESSKEY="W" TITLE="Creates a simple Windows application. The application files include a &lt;projectname&gt;.cpp file that contains the _tWinMain function, and stdafx.cpp and stdafx.h files that are used to create the precompiled header file."&gt;
	  	 			 &lt;DIV CLASS="itemTextRadioB" ID="WIN_APP_DIV" TITLE="Creates a simple Windows application. The application files include a &lt;projectname&gt;.cpp file that contains the _tWinMain function, and stdafx.cpp and stdafx.h files that are used to create the precompiled header file."&gt;
		  			  &lt;LABEL FOR="WIN_APP" ID="WIN_APP_LABEL"&gt;<U>W</U>indows application&lt;/LABEL&gt;
	  	 			 </DIV>

these are the check boxes that alow you to add more files or functionality to your app that you choose above


	  				 &lt;INPUT TYPE="checkbox" CLASS="CheckBoxA" ACCESSKEY="G" ID="GAME_APP" TITLE="This option creates a .vcproj file based on the project name you specified but adds no files to it. Use this when you intend to supply all your own source files." onPropertyChange="OnEmptyProject();"&gt;
	  	 			 &lt;DIV CLASS="itemTextCheckboxB" TITLE="This option creates a .vcproj file based on the project name you specified but adds no files to it. Use this when you intend to supply all your own source files." ID="GAME_APP_title"&gt;
		  			  &lt;LABEL FOR="GAME_APP" ID="GAME_APP_LABEL"&gt;<U>G</U>ame Loop&lt;/LABEL&gt;
	  	 			 </DIV>

	  				 &lt;INPUT TYPE="checkbox" CLASS="CheckBoxA" ACCESSKEY="D" ID="DEBUG_APP" TITLE="For DLL project only; specifies that the DLL will export symbols."&gt;
	  	 			 &lt;DIV CLASS="itemTextCheckboxB" TITLE="For DLL project only; specifies that the DLL will export symbols." ID="DEBUG_APP_title"&gt;
		  			  &lt;LABEL FOR="DEBUG_APP" ID="DEBUG_APP_LABEL"&gt;<U>D</U>ebug&lt;/LABEL&gt;
	  	 			 </DIV>

	  				 &lt;INPUT TYPE="checkbox" CLASS="CheckBoxA" ACCESSKEY="I" ID="DIRECT_3D_APP" TITLE="Specifies use of a 
precompiled header file."&gt;

	  	 			 &lt;DIV CLASS="itemTextCheckboxB" 
TITLE="Specifies use of a precompiled header file." ID="DIRECT_3D_APP_title"&gt;
		  			  &lt;LABEL FOR="DIRECT_3D_APP"
 ID="DIRECT_3D_APP_LABEL"&gt;D<U>i</U>rect 3D&lt;/LABEL&gt;
	  	 			 </DIV>

as you can see the pattern you can have as many as you want again this is the meet of your file

function InitControls()
{
	GAME_APP.disabled = true;
	GAME_APP_title.disabled = true;
	DEBUG_APP.disabled = true;
	DEBUG_APP_title.disabled = true;
	DIRECT_3D_APP.disabled = true;
	DIRECT_3D_APP_title.disabled = true;


	if (WIN_APP.checked)
	{
		GAME_APP.disabled = false;
		GAME_APP_title.disabled = false;
		DEBUG_APP.disabled = false;
	    DEBUG_APP_title.disabled = false;
	    DIRECT_3D_APP.disabled = false;
	    DIRECT_3D_APP_title.disabled = false;

	}
	
	if (window.external.FindSymbol("IS_EXPRESS_SKU"))
	{
		WIN_APP.disabled = false;
		WIN_APP_LABEL.disabled = false;
	}


	OnEmptyProject();
	ToggleImage();
}

function OnEmptyProject()
{			
			if (WIN_APP.checked)
			{
				
				GAME_APP.disabled = false;
		        GAME_APP_title.disabled = false;
		        DEBUG_APP.disabled = false;
	            DEBUG_APP_title.disabled = false;
	            DIRECT_3D_APP.disabled = false;
	            DIRECT_3D_APP_title.disabled = false;
			}
			
			if (window.external.FindSymbol("IS_EXPRESS_SKU"))
			{
				

			}
}

Next folder is the image folder I already told you what goes in there above so on to the folder Scripts\1033 which has one file in it called default.js a java script file that the above htm's load here you add in the files that you want to be copyed into your project WARNING: They can not be empty or it will not pull the file and it will crash Between /// these // are the files I added. if (strName == "gamemain.h") strTarget = "GameMain.h"; first line is the exact file name and it is case sensitive as far as I can tell second line is what it will apear in your project

function GetTargetName(strName, strProjectName, strResPath, strHelpPath)
{
	try
	{
		var strTarget = strName;

		if (strName == "readme.txt")
			strTarget = "ReadMe.txt";
		if (strName == "resource.h")
			strTarget = "Resource.h";
	//warning warning files to be added can not be empty		
			if (strName == "gamemain.h")
			strTarget = "GameMain.h";
						
			if (strName == "gamemain.cpp")
			strTarget = "GameMain.cpp";
			
			if (strName == "Debug.h")
			strTarget = "Debug.h";
			
			if (strName == "Debug.cpp")
			strTarget = "Debug.cpp";
			
			if (strName == "D3DGFX.h")
			strTarget = "D3DGFX.h";
			
			if (strName == "D3DGFX.cpp")
			strTarget = "D3DGFX.cpp";
		/////////////////////////////////////////////////////////////	
			if (strName == "resource.h")
			strTarget = "Resource.h";
		
		if (strName == "small.ico")
		{
			strTarget = "small.ico";
		}
		if (strName.substr(0, 4) == "root")
		{
			strTarget = strProjectName + strName.substr(4);

		}
		return strTarget; 
	}
	catch(e)
	{
		throw e;
	}
}

This next line translates your main apps name to the one it will use so if you have more then one make sire it is added in here

function GetAppType()
{
	try
	{
		var strAppType = "";
			if (wizard.FindSymbol("WIN_APP"))
				strAppType = "WIN";
		return strAppType;
	}
	catch(e)
	{
		throw e;
	}
}

And that is about it for this file On to the next folder templates\1033 only thing to note here is that all your files need to be in here that you will be using in your project also you have a Templates.inf folder tells the script what files to copy when

[!if WIN_APP] // the main app
readme.txt
CopyOnly | small.ico
CopyOnly | root.ico
OpenFile | root.cpp
resource.h
root.rc
root.h
[!endif]

[!if Game_APP] //sub files to include if they have been checked
gamemain.h
gamemain.cpp
[!endif]


[!if DEBUG_APP]
Debug.h
Debug.cpp
[!endif]

[!if DIRECT_3D_APP]
D3DGFX.h
D3DGFX.cpp
[!endif]

This is my first tutorial type post and hopfuly people found this imformateive and enjoyed it. If there is any issues with it let me know so I can fix it. There is a lot more adavnde things you can do like depending on the check box that has been checked will alow you to check any other one and if you know java script really well which I dont you can do just about anything. Here is my Example [Edited by - kingpinzs on July 25, 2007 8:14:45 PM]
Advertisement
Well after 5 hours I have figured out how to do it.

If any one is intrested in how to make there own wizard in express vertion I will Post how if not the saying I figured out how
Quote:
Original post by kingpinzs
If any one is intrested in how to make there own wizard in express vertion I will Post how


I'm interested. [smile]
Quote:Original post by kingpinzs
Well after 5 hours I have figured out how to do it.

If any one is intrested in how to make there own wizard in express vertion I will Post how if not the saying I figured out how


Don't even ask - post it right now [grin].
I am righting out the instructions now. I am learning a little java script while I am doing it. next post will be the complete instructions I am just working out the bugs now.
I posted the info above but I thinck it will be easyer if I just linked a text document for people to read also the sample zip files is included. Comments wanted on how well the info was presented and if anything can be changed to make it better

This topic is closed to new replies.

Advertisement