]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - setup/win32/HOWTO
ok
[xonotic/netradiant.git] / setup / win32 / HOWTO
1 Howto add new game packs to the InstallShield setup
2 ---------------------------------------------------
3
4 Background Info
5 ---------------
6 The files that IS uses are pretty much all text files, in the template/ directory
7 we have a special copy of these files that make up the IS project.
8
9 The copy in the template/ directory has files which contain string like
10 <<GTK_DIR>> which are replaced with actual values whenever the setup.pl script
11 is used.
12
13
14 TTimo
15 8/5/2002
16
17 Disclaimer: I'm writing that as I am building the RTCW game pack. It is possible
18 that it is fairly outdated when you read it, but my guess is it can be a useful
19 reference document.
20 Update: using this for JKII support, made sure everything is still valid
21
22 Hydra
23 5/6/2002
24  - Updating for Halflife build, added a bit more info in places.
25
26 NOTE: you need cygwin installed (http://www.cygwin.com) to run setup.pl tools
27 (Base installation + perl)
28
29 You also need UUIDGEN.exe in your path.  It's normally in the 
30 "Visual Studio .NET\Common7\Tools" directory
31
32 Some experience with IS and our particular way of handling it is expected.
33 The following information is DENSE, read everything
34
35 - select a base name for the pack (which we will use in various variables):
36 WOLF
37 - make a RELEASE build of GtkRadiant.
38 - run setup.pl to generate the IS directories
39   e.g. ./setup.pl 'c:\\my documents\\Source\\GtkRadiant' q3.cf
40   (the directory contains GtkRadiant, Src, etc..)
41 - start WorkDir/GtkRadiant.ipr, this is an half-templated setup we can
42 easily work on to add new stuff
43
44 - go to file groups and start adding new groups:
45 Wolf Executable Files
46   will hold the editor modules and binaries (map compiler, bspc)
47 Wolf Media Files
48   will hold sample files and editor files:
49   maps, models, additional textures, shader scripts, entities.def, project template
50 set the destination directory for those files:
51 Wolf Executable Files
52   goes in the game pack directory: DIR_GAMETOOLS_WOLF
53 Wolf Media Files
54   goes straight into the Wolf path: DIR_GAME_WOLF
55
56 - start feeding stuff in those file groups
57   make sure all those files start from the prefix we are working with
58   (C:\home\Id in my case)
59
60 - add a component:
61   Wolf (Wolf Executable Files)
62     -- Wolf editing media (Wolf Media Files)
63   NOTE: make sure that you put the file groups in those components you created!
64
65 - go to add the pack to setup.rul:
66 add new globals
67 // Wolf
68 NUMBER DO_GAME_WOLF_BOOL;
69 STRING szDIR_GAME_WOLF, szDIR_GAMETOOLS_WOLF;
70
71 - in OnFirstUIBefore
72 define any strings you use, e.g. szJKII and DEFAULTJKIIDIR;
73 add template for wolf pack inclusion
74 DO_GAME_WOLF_BOOL = <<DO_GAME_WOLF_BOOL>>;
75
76 - copy 'game pack #1' code and paste is as a 'game pack #2'
77 start renaming the code and updating it
78 (use the registry key for default path lookup if possible)
79 Wolf setup doesn't leave an install path, we will hardcode to
80 C:\\Program Files\\Return To Castle Wolfenstein
81 and look for the binary
82 (note, this is by far the part with the most things to do,
83 read carefully the game pack code, replace everywhere it's needed,
84 put the right 'BACK' code etc.)
85
86 NOTE: the 'if (nResult = BACK) then' code gets more complicated as new packs are added
87 sadly, it's not possible to store labels into variables for jumps
88 the next 'nResult = BACK' in non-gamepack code needs to be updated too
89
90 - in Dlg_SdStartCopy, add summary for Wolf operations
91     if (DO_GAME_WOLF_BOOL == 1) then
92       ListAddString(listStartCopy,"Return To Castle Wolfenstein folder:",AFTER);
93       ListAddString(listStartCopy,"             " + szDIR_GAME_WOLF,AFTER);
94       ListAddString(listStartCopy,"Return To Castle Wolfenstein mapping package folder:",AFTER);
95       ListAddString(listStartCopy,"             " + szDIR_GAMETOOLS_WOLF,AFTER);
96     endif;
97
98 - in OnMoved, add generation of the game file for Wolf
99   if (DO_GAME_WOLF_BOOL == 1) then
100     if (CreateDir(TARGETDIR ^ "games")< 0) then
101        // Report the error; then abort.
102        MessageBox ("Unable to create directory " + TARGETDIR ^ "games", SEVERE);
103        abort;
104     endif;
105     if (CreateFile(nvFileHandle, TARGETDIR ^ "games", "wolf.game")< 0) then
106       // Report the error.
107       MessageBox ("CreateFile " + TARGETDIR ^ "games" + "\\wolf.game failed.", SEVERE);
108       abort;
109     endif;
110     WriteLine(nvFileHandle, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>");
111     WriteLine(nvFileHandle, "<!-- generated by Radiant setup, modify at your own risks -->");
112     WriteLine(nvFileHandle, "<game name=\"Return To Castle Wolfenstein\" gametools=\"" + szDIR_GAMETOOLS_WOLF + "/\"/>");
113     WriteLine(nvFileHandle, "  gamename=\"wolf\"");
114     WriteLine(nvFileHandle, "  enginename=\"quake3\"");
115     CloseFile(nvFileHandle);
116   endif;
117
118 - configure the setup so that the new components are installed by default:
119   in 'Setup Types' tab, check the new components
120   NOTE: do that in BOTH types, specially Custom
121
122 - once all those changes are done, we are gonna validate the update..
123 save and exit IS
124 make a backup copy of setup/win32/WorkDir ($ cp -R WorkDir/ WorkDir-backup)
125
126 - templatize WorkDir/ with the setup.pl
127 $ ./setup.pl 'c:\\home\\Id' -template template-gen
128 Configured for base GtkRadiant directory: 'C:\\home\\Id'
129 Building a template version of WorkDir into template-gen/
130 Copy files...
131 Templating UUID...
132 Processing 'C:\\home\\Id' into '<<GTKRAD_DIR>>'
133
134 - check with a recursive diff that it's all good (Araxis Merge!)
135 Files template/Component Definitions/Default.cdf and template-gen/Component Definitions/Default.cdf differ
136 Files template/Component Definitions/Default.fgl and template-gen/Component Definitions/Default.fgl differ
137 Files template/File Groups/Default.fdf and template-gen/File Groups/Default.fdf differ
138 Files template/Script Files/Setup.rul and template-gen/Script Files/Setup.rul differ
139 Files template/Text Substitutions/Setup.tsb and template-gen/Text Substitutions/Setup.tsb differ
140
141 newly added, the file groups files
142
143 - copy over template-gen/ into template/
144 $ cp -R template-gen/* template/
145
146 - cvs update in the template dir, add new files etc.
147
148
149
150 - edit template/Component Definitions/Default.cdf in a text editor to configure the 'include in build' templates
151   search for [Wolf] and change the line:
152   INCLUDEINBUILD=NO
153   to:
154   INCLUDEINBUILD=<<DO_GAME_WOLF_BOOL_YESNO>>
155   
156   search for [Wolf\Wolf Editing Media] and change the line:
157   INCLUDEINBUILD=NO
158   to:
159   INCLUDEINBUILD=<<DO_GAME_WOLF_BOOL_FULL_YESNO>>
160
161   that is, main is always installed, and the editing media only in full
162   NOTE: IS 6.0 has the nasty habit of changing order in Default.cdf on each save .. makes things harder
163
164 - edit 'sub configure_tree' in setup/win32/setup.pl:
165   copy from an existing game pack code and adapt
166   there's a general boolean, and a full setup boolean
167   (search and replace affects Setup.rul and Default.cdf)
168
169   add the corresponding items to
170   # set default config
171   
172   add a corresponding output string under
173   print "  DO_CORE          : $DO_CORE\n";
174
175 - search for '# set default config' and add the new default entry (default to 0)
176 as well as the verbosity below
177
178 - create a new .cf file
179
180 # ET setup
181
182 # output dir name
183 $SETUP_DIR = 'Setup-ET';
184
185 $DO_CORE = 1;
186 $DO_GAME_ET = 1;
187
188
189 - build a new setup using a .cf file.
190
191 e.g.
192
193 ./setup.pl 'C:\\home\\Id' wolf.cf
194
195 - load up Setup-Wolf/GtkRadiant.ipl into IS and build it!