Installers

F4Browse, CATE, Tacedit, Terrainview & TheaterMaker etc utility related

Moderators: Lone Wolf, Snake Man

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-05 02:45:03

Just a note on the registry thing :) PortableApps (of which I am a BIG fan) write to the registry only for as long as the program is running, then when it closes, they delete the registry values. That's the kind of thing I'd do with SPTinstall.

But, I think there's also a way to extract the htti tool from the hitiles installer.
Sic Semper tyrannosauro.

User avatar
Khronik
PMC Theater Developer
Posts: 51
Joined: 2006-05-02 22:01:01
Location: montreal quebec canada

Post by Khronik » 2007-04-05 03:38:09

This should work with NSIS...

WriteRegStr HKLM "Software\Microprose\Falcon\4.0" "baseDir" "C:\Falcon4"

to Remove..

DeleteRegKey HKLM "Software\Microprose\Falcon\4.0"

Im not exactly sure what line its looking for but it cant be more than one. As for the specific path for F4's location, I dont think its important as your already pointing SPTinstall with the -auto c:\path, must just be checking if a key exists with microprose/falcon/etc..

User avatar
Khronik
PMC Theater Developer
Posts: 51
Joined: 2006-05-02 22:01:01
Location: montreal quebec canada

Post by Khronik » 2007-04-05 03:46:45

Snake Man wrote:
So does anyone know for a fact that htti.exe wont need anything on the registry? Yet I still think we need to make just brand new util, one which replaces SPTInstall.exe and LxNormalFix.exe utils...
Htti.exe does not need an existing F4 registry key or install. Might even work without an AF regkey, as it actually defaults to the ol' falcon 4 registry path if run without switches. It works just like SPTinstall does, ie, the same switches work and they work the same way. Htti.exe seems to be nothing more than a Lp modded version of SPTinstall for a AF regkey path but they seemed to integrate some sort of Lx normals fix.

Htti.exe mentions recaculating normals but it seems it will only do so with AF stock campaigns and it takes nowhere as much time as with Lxnormalfix so cant really say if its the same. (you can see in the progress bar saying "normalizing terrain Lx" etc.)

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-05 12:07:49

Yeah, I was thinking about this more overnight, and I figure it must only be looking for the basdir to validate the install. Everything else - file locations, etc. - is set by the switches. Just like Khronik says, would be easy to put into the installer.

Your call SM, on which direction you want to go. :)
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-05 12:46:00

I have always hated installers for GAME ADDONS that fuck up your registry, am I now becoming one of these loosers who do such installers?

I dont think so!

I still want to go with the route of making brand new util to rebuild the terrain AND fix normals since LxNormalFix is so horrible.

Yes yes I know all about that we can add the registry and then delete it, but... still, I dont feel good about it. Its a principle more than anything else, like I said on the beginning of this post.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-05 13:04:28

hehehe

Ok. :)

I'm down with acting on principle. :D

Perhaps we can do something for the people who have already downloaded the installer? I (or Khronik) can make a little utility that checks if the reg value is there, and if it isn't, it adds it. Maybe even give the user the option of deleting it, if they want. They can run this, THEN run the installer.

It becomes a 2 step process, but I feel bad for the people who've downloaded it and can't install it, ya know. :) I think something like that is better than having someone try to manually mess with their registry. 8)
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-05 13:12:58

Ok lets discuss the ODS v0.6 registry/etc FIX in ODS topic and keep this for the NSIS installer script development.

So again to recap one more time, without SPTInstall there is or isn't any problem with the not having Falcon 4.0 installed but just AF? Ie if we get a new util, the NSIS installer works ok or not?
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

User avatar
Khronik
PMC Theater Developer
Posts: 51
Joined: 2006-05-02 22:01:01
Location: montreal quebec canada

Post by Khronik » 2007-04-05 16:05:35

Snake Man wrote:I have always hated installers for GAME ADDONS that fuck up your registry, am I now becoming one of these loosers who do such installers?

I dont think so!
Your installer is broken for AF users without F4 installed.
Snake Man wrote:
So again to recap one more time, without SPTInstall there is or isn't any problem with the not having Falcon 4.0 installed but just AF? Ie if we get a new util, the NSIS installer works ok or not?
SPTinstall = Needs F4 paths (baseDir / theaterdir) in registry
Htti = Will run for with or without F4 path in registry.

As long as SPTinstall sees a baseDir and theaterdir in F4's regkey your installer should work for all versions.

F4 = OLD FALCON

Couby
1st Lt
Posts: 127
Joined: 2006-12-25 22:35:21
Location: France
Contact:

Post by Couby » 2007-04-05 20:43:25

So what's needed is simply a check of registry keys here or not.
If yes -> SPTInstall process
If not -> Htti

Nope :?: :oops:

Khronik wrote:F4 = OLD FALCON
I prefer "F4 = FALCON ORIGINAL", but that's just a question of taste :wink: .
ImageImage

User avatar
Khronik
PMC Theater Developer
Posts: 51
Joined: 2006-05-02 22:01:01
Location: montreal quebec canada

Post by Khronik » 2007-04-05 20:46:47

I prefer "F4 = FALCON ORIGINAL", but that's just a question of taste :wink: .
Heh, technically AF is the OLD falcon now-a-days! Im a RV whore.

BTW, FALCON ORIGINAL would be FO, and we dont want to go there. :lol:

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-05 20:50:04

Hey - here's a question - will HTTI work on F4 theaters?

I mean, do we need SPTI at all?

I remember something about the terrain being a little different for AF, but if it is a matter of deleting some text or something, I *think* I can do that within an installer.
Sic Semper tyrannosauro.

Couby
1st Lt
Posts: 127
Joined: 2006-12-25 22:35:21
Location: France
Contact:

Post by Couby » 2007-04-05 20:53:40

Khronik wrote: Heh, technically AF is the OLD falcon now-a-days! Im a RV whore.

BTW, FALCON ORIGINAL would be FO, and we dont want to go there. :lol:
:lol: :lol:
ImageImage

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-09 12:17:42

Now that we have couple of installers out we need a new feature for the script: how to check if theater dirs already exist in users F4 installation and if so, abort the installer with message box that previous version not uninstalled.

There are few hardcoded places we need to look, lets take example ODS, I believe the original v0.512 came in some <falconroot>\DesertStormTheaterAddon\ dir or similar, I cant remember would need to check. Then of course ODSAF and v0.6 directories. Other PMC theaters have just one directory where they have been installed.

So T_Rex, how such code would look like? :)
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-09 13:41:54

hehehe

Pretty easy to do. :)

But what is the goal? Isn't the potential conflict solved by the theater.lst? :D That determines where F4 looks for that theater, right?

And in terms of aborting, what if the person wants to over-write? We can have the script ask if they want to over-write or abort. If they want to over-write, we can even have the installer delete the previous install before installing the new version - or only delete certain files, or just over-write completely. Heck, I can probably work out how to convert a non-standard-directory setup into the PMC standard. :D

I suppose we could even have an option for renaming the new theater, and having that name applied to the theater.lst. That would be trickier, but possible. That might be for people that want to try a new release, but want to keep the older version, too. Of course, that's why they invented backup utilities, too. :D
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-09 15:55:43

The goal is to not have older versions installed.

Overwriting is not an option, not for ODS v0.512 or ODSAF conversion and for from v0.6 -> v0.7 change, there might be files which cause conflict so overwrite is not something I want to do. Same applies to other PMC theaters which only have one dir specified in history books.

The installer could ask the user if he wants to delete the older installs and if user chooses yes, it would nuke all the specified dirs (three known hardcoded locations now). But I hope this is safe so it wont delete anything else except the specified dirs.

No renaming of any theaters.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-09 16:31:30

Snake Man wrote:The goal is to not have older versions installed.
Ok. So, we know what the "new" installer subdir is going to be, so we just check if that directory already exists, and if it is there, we prompt to either delete the subdir or cancel the installation?
The installer could ask the user if he wants to delete the older installs and if user chooses yes, it would nuke all the specified dirs (three known hardcoded locations now). But I hope this is safe so it wont delete anything else except the specified dirs.
That's what testing is for. ;) :)

It should only delete the folders we tell it to delete. :thumbs:
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-09 16:37:20

Yes, prompt for delete or cancel installation. If it would display the name of the dirs to be deleted it would be nice touch, but not necessarily.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-09 19:50:20

Ok, I've updated the first post, with some other changes I've made to my template script to clean up the use of some generic variables.

It *might* be easier, though, if you want to send me the ODS script and the list of directories to look for to delete, and I can show you what I did.

Or, I can go through the lines I added - whatever will help people figure out what's different. :)

I'll not claim it is the most elegant way to handle it, but it gets the job done. :)

BTW, if there are more than previous installs, it could act kinda funky.
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-09 20:12:26

Okay I grabbed the script from the first post, thanks.

But I start to freak out with all the updates into the installers now as I have so many theaters in my dir.

Theater_Afghan.nsi
Theater_DesertStorm.nsi
Theater_Europe.nsi
Theater_Iran.nsi
Theater_Korea128.nsi
Theater_Nevada.nsi
Theater_Taiwan.nsi
Theater_Vietnam.nsi

Uuh. I think we really need to make some basic master script which I then apply for all theaters. I have tried to do the variable thing for ODS so we could almost have the variables set on the beginning and then just have "DONT EDIT BELOW THIS LINE!" type of thing where you really dont have to touch the installer. But its not simple as that as some theaters have multiple art dirs (ODS, Europe, Vietnam), some have textures while others dont... its a mess :)

I guess I just have to maintain one master script and each and every time I update one of the theaters, I copy paste all the latest goodies from the master .nsi file. Its a pain but... well damn, if I wanted a easy life I would be a looser in frugals with big signature bitching about everything. Go figure.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-09 20:17:03

Snake Man wrote:Its a pain but... well damn, if I wanted a easy life I would be a looser in frugals with big signature bitching about everything. Go figure.
LMAO

:D

I know exactly how you feel, though. :D

I've started keeping a couple templates for installers. And, if I need to update an older one, I just take the parts I need out of one of the templates. I'm trying to keep them as standard as I can, but it is hard.

The other part of the problem is that I keep learning stuff! :D (Dammit!) So, when I figure something else out, I add it to whatever I'm working on, then go back and add it to the template.

Sometimes feels like I'm running in circles. :D
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-11 16:25:16

I didn't try your original delete code yet, but I tried to do some database adding and used the one command there. Like this

Code: Select all

RMDir "$0\Theaters\${TNAME}\objects\F4AF"
the objects\F4AF\ directory has some files in it, but the command should still recursively delete the whole dir right?

Well it aint, dunno whats wrong, I dont see anything wrong in that cmd line so hum, any ideas?
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-11 16:39:49

Snake Man wrote:

Code: Select all

RMDir "$0\Theaters\${TNAME}\objects\F4AF"
Well it aint, dunno whats wrong, I dont see anything wrong in that cmd line so hum, any ideas?
This is one of the quirks of NSIS.

Try:

Code: Select all

RMDir "$0\Theaters\${TNAME}\objects\F4AF"
or

Code: Select all

RMDir "$0\Theaters\${TNAME}\objects\F4AF\*.*"
Also, add the /r switch for recursive:

Code: Select all

RMDir /r "$0\Theaters\${TNAME}\objects\F4AF"
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-11 17:05:06

Okay I added the /r and ending \ which made it to work ok, dunno because I believe I already tried the ending \ but no luck, perhaps its the /r parameter then. Anyways it works, thanks.

I think we need to add some clear point in the script after this part

Code: Select all

; unpack the theater files 
; this is the subdir in the developer's PC that has the files for AF 
File /r "Theater_src_${TNAME}\*.*" 
Which would copy the UI and database files according to which version we run. Right now I made this lame setup which I dont even know if it works

Code: Select all

; unpack the theater files 
; this is the subdir in the developer's PC that has the files for AF 
File /r "Theater_src_${TNAME}\*.*" 

; database copy
StrCmp $7 "OF" DataBaseOF
StrCmp $7 "RV" DataBaseRV

; database AF
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\AF\*.*" "$0\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy

DataBaseOF:
; database OF
;CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\OF\*.*" "$0\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy

DataBaseRV:
; database RV
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\RV\*.*" "$0\Theaters\${TNAME}\objects\"

EndOfDataBaseCopy:
RMDir /r "$0\Theaters\${TNAME}\objects\F4AF\"
RMDir /r "$0\Theaters\${TNAME}\objects\RV\"
RMDir /r "$0\Theaters\${TNAME}\objects\OF\"
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-11 17:35:55

Ok, I *think* I understand what you're trying to do.

[quote="Snake Man"]

Code: Select all

; unpack the theater files 
; this is the subdir in the developer's PC that has the files for AF 
File /r "Theater_src_${TNAME}\*.*" 
I think for this part, you'll need to specify where the Theater_src is, unless it is a direct subdir of where your script is.

Code: Select all

; unpack the theater files 
; this is the subdir in the developer's PC that has the files for AF 
File /r "Theater_src_${TNAME}\*.*" 
Make sure right above this you have a SetOutPath command that specifies where you want this installed on the user's computer.

Code: Select all

; database copy
StrCmp $7 "OF" DataBaseOF
StrCmp $7 "RV" DataBaseRV

; database AF
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\AF\*.*" "$0\Theaters\${TNAME}\objects"
goto EndOfDataBaseCopy
Ok, you're assuming that if it gets passed the $7 compares, that it is AF? Might want to have a compare anyway with $8 and if none match, kick an error code.

Also, you're copying from the folder $0 (which I think is F4root on the user's PC)\theaters\tname\objects\AF to the F4root\theaters\tname\objects?

Code: Select all

DataBaseOF:
; database OF
;CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\OF\*.*" "$0\Theaters\${TNAME}\objects"
goto EndOfDataBaseCopy
Need to remove the semicolon in front of the copyfiles.

Code: Select all

DataBaseRV:
; database RV
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\RV\*.*" "$0\Theaters\${TNAME}\objects"

EndOfDataBaseCopy:
RMDir /r "$0\Theaters\${TNAME}\objects\F4AF"
RMDir /r "$0\Theaters\${TNAME}\objects\RV"
RMDir /r "$0\Theaters\${TNAME}\objects\OF"
Ok, so you're packing all the different objects into different subdirs on the user PC, then deleting all of them once you decide what you need?

You could also have separate File commands for each one.

Let me know if you want to try that. You just have to remove the objects from the "big" file/unpack line, and set them up in separate subdirs kinda like you already have.
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-11 18:24:07

I want to include the edited database files and copy these over the original database. This of course has to be done for all versions.

Same goes for UI files of course.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-12 07:33:39

Does Copyfiles command have a /r parameter for recursively copy?

This is the current initial database copying command

Code: Select all

; database objects (same dir for all versions)
CopyFiles /filesonly "$0\terrdata\objects\*.*" "$0\Theaters\${TNAME}\objects\"
But in RV you got the koreaobj directory where some dds textures are located, this is not copied with this command.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-12 12:10:52

You need to remove the /filesonly switch. :) That only copies files - not subdirectories. With the *.* it will copy all subdirectories, also.
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-16 11:33:57

I'm having a little bit problems when implementing the delete previous theater dirs thingy. Dunno if its your example or my trying ot use it, but it said checkprevious and $errcode variable was not used.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-16 11:59:59

Snake Man wrote:I'm having a little bit problems when implementing the delete previous theater dirs thingy. Dunno if its your example or my trying ot use it, but it said checkprevious and $errcode variable was not used.
hehehe

Ok, an you send me your script - either email/pm/or posted. :)
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-04-17 14:47:57

I have been thinking about this, its going to be more and more of a mess right now and we really need to organize this as at least I do not have the luxury of time of pondering the command lines for the installer.

We need to only use ODS nsis for all of the future script editing because it has all of the needed stuff; new tiles, three campaign dirs and database objects dir.

So this is the latest ODS nsis file with the added database installing setup, which seems to work ok. This needs now the three different UI installing setups also. I'm not completely sure how we will handle it, most likely we just make one common UI dir like resource/campmap.* which is same for all versions and then the "incremental" update files which each version needs. Here is the nsis:

Code: Select all

!define TNAME "DesertStorm" 
!define FRIENDLYNAME "PMC Operation Desert Storm Theater Installer" 
!define APP "DesertStormInstaller" 
;for some reason, this has to be #.#.#.# but I usually change the name after I build the exe 
!define VER "0.0.0.6" 

; these establish some things about the installer the most important one to me is the outfile 
Name "${FRIENDLYNAME}" 
; outfile is the name of the installer.  Unless otherwise set, it will be the same directory as where the script is 
OutFile "PMC_${TNAME}_Theater_v${VER}.exe" 
Caption "${FRIENDLYNAME}" 
; these VI definitions are what is displayed if you hover the mouse over the icon 
VIProductVersion "${VER}" 
VIAddVersionKey ProductName "${FRIENDLYNAME}" 
VIAddVersionKey Comments "Installs the Operation Desert Storm theater." 
VIAddVersionKey LegalCopyright "PMC Tactical" 
VIAddVersionKey FileDescription "${FRIENDLYNAME}" 
VIAddVersionKey FileVersion "${VER}" 
VIAddVersionKey ProductVersion "${VER}" 
VIAddVersionKey InternalName "${FRIENDLYNAME}" 

;=== Runtime Switches 
; the CRC check is something I use on bigger installers to make sure everything checks out. 
CRCCheck On 
; this makes it more efficient 
AutoCloseWindow True 
; this is something I use to make sure it uses the LZMA compression, which I believe is the best 
SetCompressor lzma 
; branding text is just something that's displayed at the bottom of the installer 
BrandingText "http://www.pmctactical.org" 

;=== Includes - this will include the necessary dlls and functions that I use in the installer 
; MUI 1.67 compatible ------ 
!include "MUI.nsh" 
!include "Registry.nsh" 
!include "WinMessages.nsh" 
!include "TextFunc.nsh" 
!include "Sections.nsh" 

; MUI Settings - the MUI is the Modern UI for NSIS, this section defines its parameters (there are alot more that I don't use) 
!define MUI_ABORTWARNING 
!define MUI_INSTALLCOLORS /windows 

; Welcome page - this is the first page of the installer (I also have a snippet for a splashscreen, but we'll keep this simple) 
;!define MUI_WELCOMEFINISHPAGE_BITMAP "@@:\FF4Installers\leftgraphic.bmp" 
; using the variables means we don't have to remember to change all these when we use the template for another theater 
!define MUI_WELCOMEPAGE_TITLE "${FRIENDLYNAME} ${VER} Setup Wizard" 
!define MUI_WELCOMEPAGE_TEXT "Setup will install ${FRIENDLYNAME} ${VER} into your Falcon installation." 
!insertmacro MUI_PAGE_WELCOME 

!define MUI_LICENSEPAGE_RADIOBUTTONS 
!insertmacro MUI_PAGE_LICENSE "Theater_src_${TNAME}\Theaters\${TNAME}\EULA.txt" 

; Instfiles page 
!define MUI_FINISHPAGE_NOAUTOCLOSE 
!insertmacro MUI_PAGE_INSTFILES 
; Finish page - this is the last page people see 
!define MUI_FINISHPAGE_TITLE "${FRIENDLYNAME} ${VER} Installation completed." 
!define MUI_FINISHPAGE_TEXT "Click 'Finish' to close this wizard." 
!insertmacro MUI_PAGE_FINISH 

; Language files 
!insertmacro MUI_LANGUAGE "English" 
; MUI end ------ 

; now we're ready for the actual installer! 
Section "Installer" SEC01 

; F4registry check - if no F4 registry, it kicks to the end - the $0 is a variable that holds the -1 (not found) or 0 (found) 
; we can also start to determine which install we have 
${registry::KeyExists} "HKLM\Software\MicroProse\Falcon\4.0" $0 
${registry::KeyExists} "HKLM\Software\Lead Pursuit\Battlefield Operations\Falcon" $1 
; IntCmp compares the integer in $0 with our number (0) and if it is =, it goes to label "F4Exists" 
IntCmp $0 0 F4Exists 
IntCmp $1 0 AFInstall 
; this copies the string to $9 - I'm using that as an error label 
StrCpy $9 "No appropriate registry found." 
Goto Error 

F4Exists:
; this determines if there's an AF reg entry, and if so, it only advances 1 line, if not, it goes to F4Install
IntCmp $1 0 0 F4Version

; at this point, we need to determine if the person wants to install over "original" F4 or RV

Messagebox::show MB_DEFBUTTON3|MB_TOPMOST "" "" "Select where you want the theater installed." "OF/RV" "AF" IDCANCEL
; this places the response 1, 2, or 3, into $0
Pop $0
IntCmp $0 3 Finish
IntCmp $0 2 AFInstall

F4Version:
; now we know they want OF/RV so we need to differentiate - I'm only going to look for RV, if it isn't RV, I'm going to assume OF for now
; this will also validate the install a bit
; this reads the specified registry value into $0
ReadRegStr $0 HKLM "Software\MicroProse\Falcon\4.0" "basedir"
; if the file exists, go to next line (don't skip a line) if it doesn't, go to label "NoFileFound"
IfFileExists $0\theater.lst 0 NoFileFound
IfFileExists $0\terrdata\objects\KoreaObj.Dxl RVFound
IfFileExists $0\terrdata\objects\KoreaObj.lod OFFound NoFileFound

NoFileFound: 
StrCpy $9 "No F4 install found." 
Goto Error 

; I want to set up a variable to differentiate OF and RV 
RVFound: 
; we'll use this for the lstupdate variable 
StrCpy $8 "F4" 
StrCpy $7 "RV" 
Goto F4Install 

OFFound: 
StrCpy $8 "F4" 
StrCpy $7 "OF" 
Goto F4Install 

AFInstall: 
; get the AF base directory into a variable 
ReadRegStr $0 HKLM "Software\Lead Pursuit\Battlefield Operations\Falcon" "basedir" 
; sets the right campaign directory 
StrCpy $1 "$0\campaign\korea" ; campaing\save string 
StrCpy $2 "$0\Utilities\LxNormalFix.exe $$LP @${TNAME} @$0\Theaters\${TNAME}\terrdata" ; lxnormalfix string 
StrCpy $8 "AF" 
Goto CreateDirs 

F4Install: 
ReadRegStr $0 HKLM "Software\MicroProse\Falcon\4.0" "basedir" 
StrCpy $1 "$0\campaign\save" 
StrCpy $2 "$0\Utilities\LxNormalFix.exe @${TNAME} @$0\Theaters\${TNAME}\terrdata" 

CreateDirs: 
SetOutPath $0 
CreateDirectory "$0\Theaters\${TNAME}\campaign\DesertStorm1"
CreateDirectory "$0\Theaters\${TNAME}\campaign\DesertStorm2"
CreateDirectory "$0\Theaters\${TNAME}\campaign\DesertStorm3"
CreateDirectory "$0\Theaters\${TNAME}\art\DesertStorm2\art\resource"
CreateDirectory "$0\Theaters\${TNAME}\art\DesertStorm3\art\resource"
CreateDirectory "$0\Theaters\${TNAME}\terrdata\weather\"

; new intelligent campaing copy files list
CopyFiles /filesonly "$1\*.pri" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.txt" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.b" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.db" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.ia" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.dfs" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.dat" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.gbd" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.lst" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.idx" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.wch" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\atc.ini" "$0\Theaters\${TNAME}\campaign\DesertStorm1\" 
CopyFiles /filesonly "$1\falcon4.aii" "$0\Theaters\${TNAME}\campaign\DesertStorm1\" 
CopyFiles /filesonly "$1\falcon4.rt" "$0\Theaters\${TNAME}\campaign\DesertStorm1\" 
CopyFiles /filesonly "$1\falcon4.tt" "$0\Theaters\${TNAME}\campaign\DesertStorm1\" 
CopyFiles /filesonly "$1\validac.*" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"

; then copy it to the two another campaign dirs
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\*.*" "$0\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\*.*" "$0\Theaters\${TNAME}\campaign\DesertStorm3\"

CopyFiles "$0\terrdata\korea\weather\*.*" "$0\Theaters\${TNAME}\terrdata\weather\"

; unpack the theater files 
; this is the subdir in the developer's PC that has the files for AF 
File /r "Theater_src_${TNAME}\*.*" 

; snake try to make campmap and campaign files included only once
;campmap
CopyFiles /filesonly "$0\Theaters\${TNAME}\art\DesertStorm1\art\resource\campmap.*" "$0\Theaters\${TNAME}\art\DesertStorm2\art\resource\"
CopyFiles /filesonly "$0\Theaters\${TNAME}\art\DesertStorm1\art\resource\campmap.*" "$0\Theaters\${TNAME}\art\DesertStorm3\art\resource\"
;campaign files
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\desertstorm.*" "$0\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\desertstorm.*" "$0\Theaters\${TNAME}\campaign\DesertStorm3\"
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\kneemap.gif" "$0\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\kneemap.gif" "$0\Theaters\${TNAME}\campaign\DesertStorm3\"

; database copy
StrCmp $7 "OF" DataBaseOF
StrCmp $7 "RV" DataBaseRV

; database AF
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\AF\*.*" "$0\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy

DataBaseOF:
; database OF
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\OF\*.*" "$0\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy

DataBaseRV:
; database RV
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\RV\*.*" "$0\Theaters\${TNAME}\objects\"

EndOfDataBaseCopy:
RMDir /r "$0\Theaters\${TNAME}\objects\F4AF\"
RMDir /r "$0\Theaters\${TNAME}\objects\RV\"
RMDir /r "$0\Theaters\${TNAME}\objects\OF\"

StrCmp $8 "F4" F4curTheater TheaterAdmin 

StrCpy $9 "Unknown error before curTheater: $8." 
Goto Error 

F4curTheater: 
; set current theater to new theater 
; this reads the specified registry value into $2 for use later
ReadRegStr $3 HKLM "Software\MicroProse\Falcon\4.0" "curTheater"
${registry::Write} "hklm\SOFTWARE\MicroProse\Falcon\4.0" "curTheater" "Operation Desert Storm" "REG_SZ" $R0

; if it is an OF install, skip straight to theater admin otherwise, do RV stuff
StrCmp $7 "OF" TheaterAdmin

; this will be the area where we do stuff that it doesn't really matter which install it is 
TheaterAdmin: 
SetOutPath $0 

; plus additional two lstupdate entries
ExecWait "$0\Utilities\lstupdate.exe $8 +Theaters\${TNAME}\${TNAME}1.tdf" 
ExecWait "$0\Utilities\lstupdate.exe $8 +Theaters\${TNAME}\${TNAME}2.tdf" 
ExecWait "$0\Utilities\lstupdate.exe $8 +Theaters\${TNAME}\${TNAME}3.tdf" 
ExecWait '$0\Utilities\SPTinstall.exe -auto "$0\Theaters\${TNAME}\terrdata"'
ExecWait "$0\Utilities\LxNormalFix.exe $2" 

; just compress textures if F4 then finish 
StrCmp $8 "AF" Finish 
ExecWait "$0\Utilities\SeasonSwitcher.exe -0"

MessageBox MB_YESNO "Do you want to make the new theater the current one?" IDYES Finish IDNO OldReg 
OldReg: 
${registry::Write} "hklm\SOFTWARE\MicroProse\Falcon\4.0" "curTheater" "$3" "REG_SZ" $R0 

Goto Finish 

Error: 
Messagebox MB_OK $9 

Finish: 

SectionEnd
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-17 17:45:25

Ok, I'll check it as soon as I can.... might be awhile.
Sic Semper tyrannosauro.

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-04-17 18:40:57

Ok, Snakey-

Try this, and let me know what errors you might get. :)

Code: Select all

!define TNAME "DesertStorm"
!define FRIENDLYNAME "PMC Operation Desert Storm Theater Installer"
!define APP "DesertStormInstaller"
;for some reason, this has to be #.#.#.# but I usually change the name after I build the exe
!define VER "0.0.0.6"

; define other variables to free up generic ones
var F4root
var ErrCode
var F4ver
var F4subver

; these establish some things about the installer the most important one to me is the outfile
Name "${FRIENDLYNAME}"
; outfile is the name of the installer.  Unless otherwise set, it will be the same directory as where the script is
OutFile "PMC_${TNAME}_Theater_v${VER}.exe"
Caption "${FRIENDLYNAME}"
; these VI definitions are what is displayed if you hover the mouse over the icon
VIProductVersion "${VER}"
VIAddVersionKey ProductName "${FRIENDLYNAME}"
VIAddVersionKey Comments "Installs the Operation Desert Storm theater."
VIAddVersionKey LegalCopyright "PMC Tactical"
VIAddVersionKey FileDescription "${FRIENDLYNAME}"
VIAddVersionKey FileVersion "${VER}"
VIAddVersionKey ProductVersion "${VER}"
VIAddVersionKey InternalName "${FRIENDLYNAME}"

;=== Runtime Switches
; the CRC check is something I use on bigger installers to make sure everything checks out.
CRCCheck On
; this makes it more efficient
AutoCloseWindow True
; this is something I use to make sure it uses the LZMA compression, which I believe is the best
SetCompressor lzma
; branding text is just something that's displayed at the bottom of the installer
BrandingText "http://www.pmctactical.org"

;=== Includes - this will include the necessary dlls and functions that I use in the installer
; MUI 1.67 compatible ------
!include "MUI.nsh"
!include "Registry.nsh"
!include "WinMessages.nsh"
!include "TextFunc.nsh"
!include "Sections.nsh"

; MUI Settings - the MUI is the Modern UI for NSIS, this section defines its parameters (there are alot more that I don't use)
!define MUI_ABORTWARNING
!define MUI_INSTALLCOLORS /windows

; Welcome page - this is the first page of the installer (I also have a snippet for a splashscreen, but we'll keep this simple)
;!define MUI_WELCOMEFINISHPAGE_BITMAP "@@:\FF4Installers\leftgraphic.bmp"
; using the variables means we don't have to remember to change all these when we use the template for another theater
!define MUI_WELCOMEPAGE_TITLE "${FRIENDLYNAME} ${VER} Setup Wizard"
!define MUI_WELCOMEPAGE_TEXT "Setup will install ${FRIENDLYNAME} ${VER} into your Falcon installation."
!insertmacro MUI_PAGE_WELCOME

!define MUI_LICENSEPAGE_RADIOBUTTONS
!insertmacro MUI_PAGE_LICENSE "Theater_src_${TNAME}\Theaters\${TNAME}\EULA.txt"

; Instfiles page
!define MUI_FINISHPAGE_NOAUTOCLOSE
!insertmacro MUI_PAGE_INSTFILES
; Finish page - this is the last page people see
!define MUI_FINISHPAGE_TITLE "${FRIENDLYNAME} ${VER} Installation completed."
!define MUI_FINISHPAGE_TEXT "Click 'Finish' to close this wizard."
!insertmacro MUI_PAGE_FINISH

; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------

; now we're ready for the actual installer!
Section "Installer" SEC01

; F4registry check - if no F4 registry, it kicks to the end - the $0 is a variable that holds the -1 (not found) or 0 (found)
; we can also start to determine which install we have
${registry::KeyExists} "HKLM\Software\MicroProse\Falcon\4.0" $0
${registry::KeyExists} "HKLM\Software\Lead Pursuit\Battlefield Operations\Falcon" $1
; IntCmp compares the integer in $0 with our number (0) and if it is =, it goes to label "F4Exists"
IntCmp $0 0 F4Exists
IntCmp $1 0 AFInstall
; this copies the string to $ErrCode - I'm using that as an error label
StrCpy $ErrCode "No appropriate registry found."
Goto Error

F4Exists:
; this determines if there's an AF reg entry, and if so, it only advances 1 line, if not, it goes to F4Install
IntCmp $1 0 0 F4Version

; at this point, we need to determine if the person wants to install over "original" F4 or RV

Messagebox::show MB_DEFBUTTON3|MB_TOPMOST "" "" "Select where you want the theater installed." "OF/RV" "AF" IDCANCEL
; this places the response 1, 2, or 3, into $0
Pop $0
IntCmp $0 3 Finish
IntCmp $0 2 AFInstall

F4Version:
; now we know they want OF/RV so we need to differentiate - I'm only going to look for RV, if it isn't RV, I'm going to assume OF for now
; this will also validate the install a bit
; this reads the specified registry value into $0
ReadRegStr $F4root HKLM "Software\MicroProse\Falcon\4.0" "basedir"
; if the file exists, go to next line (don't skip a line) if it doesn't, go to label "NoFileFound"
IfFileExists $F4root\theater.lst 0 NoFileFound
IfFileExists $F4root\terrdata\objects\KoreaObj.Dxl RVFound
IfFileExists $F4root\terrdata\objects\KoreaObj.lod OFFound NoFileFound

NoFileFound:
StrCpy $ErrCode "No F4 install found."
Goto Error

; I want to set up a variable to differentiate OF and RV
RVFound:
StrCpy $F4ver "F4"
StrCpy $F4subver "RV"
Goto F4Install

OFFound:
StrCpy $F4ver "F4"
StrCpy $F4subver "OF"
Goto F4Install

AFInstall:
; get the AF base directory into a variable
ReadRegStr $F4Root HKLM "Software\Lead Pursuit\Battlefield Operations\Falcon" "basedir"
; sets the right campaign directory
StrCpy $1 "$F4Root\campaign\korea" ; campaing\save string
StrCpy $2 "$F4Root\Utilities\LxNormalFix.exe $$LP @${TNAME} @$F4Root\Theaters\${TNAME}\terrdata" ; lxnormalfix string
StrCpy $F4Ver "AF"
Goto CreateDirs

F4Install:
ReadRegStr $F4Root HKLM "Software\MicroProse\Falcon\4.0" "basedir"
StrCpy $1 "$F4Root\campaign\save"
StrCpy $2 "$F4Root\Utilities\LxNormalFix.exe @${TNAME} @$F4Root\Theaters\${TNAME}\terrdata"

CreateDirs:
SetOutPath $F4Root
CreateDirectory "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1"
CreateDirectory "$F4Root\Theaters\${TNAME}\campaign\DesertStorm2"
CreateDirectory "$F4Root\Theaters\${TNAME}\campaign\DesertStorm3"
CreateDirectory "$F4Root\Theaters\${TNAME}\art\DesertStorm2\art\resource"
CreateDirectory "$F4Root\Theaters\${TNAME}\art\DesertStorm3\art\resource"
CreateDirectory "$F4Root\Theaters\${TNAME}\terrdata\weather\"

SetOutPath "$F4root\Theaters\${TNAME}"

; new intelligent campaing copy files list
CopyFiles /filesonly "$1\*.pri" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.txt" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.b" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.db" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.ia" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.dfs" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.dat" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.gbd" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.lst" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.idx" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.wch" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\atc.ini" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\falcon4.aii" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\falcon4.rt" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\falcon4.tt" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\validac.*" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"

; then copy it to the two another campaign dirs
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\*.*" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\*.*" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm3\"

CopyFiles "$F4Root\terrdata\korea\weather\*.*" "$F4Root\Theaters\${TNAME}\terrdata\weather\"

; unpack the theater files
; this is the subdir in the developer's PC that has the files for AF
File /r "Theater_src_${TNAME}\*.*"

; snake try to make campmap and campaign files included only once
;campmap
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\art\DesertStorm1\art\resource\campmap.*" "$F4Root\Theaters\${TNAME}\art\DesertStorm2\art\resource\"
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\art\DesertStorm1\art\resource\campmap.*" "$F4Root\Theaters\${TNAME}\art\DesertStorm3\art\resource\"
;campaign files
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\desertstorm.*" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\desertstorm.*" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm3\"
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\kneemap.gif" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\kneemap.gif" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm3\"

; database copy
StrCmp $F4subver "OF" DataBaseOF
StrCmp $F4subver "RV" DataBaseRV

; database AF
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\objects\AF\*.*" "$F4Root\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy

DataBaseOF:
; database OF
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\objects\OF\*.*" "$F4Root\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy

DataBaseRV:
; database RV
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\objects\RV\*.*" "$F4Root\Theaters\${TNAME}\objects\"

EndOfDataBaseCopy:
RMDir /r "$F4Root\Theaters\${TNAME}\objects\F4AF\"
RMDir /r "$F4Root\Theaters\${TNAME}\objects\RV\"
RMDir /r "$F4Root\Theaters\${TNAME}\objects\OF\"

StrCmp $F4ver "F4" F4curTheater TheaterAdmin

StrCpy $ErrCode "Unknown error before curTheater: $F4ver."
Goto Error

F4curTheater:
; set current theater to new theater
; this reads the specified registry value into $3 for use later
ReadRegStr $3 HKLM "Software\MicroProse\Falcon\4.0" "curTheater"
${registry::Write} "hklm\SOFTWARE\MicroProse\Falcon\4.0" "curTheater" "Operation Desert Storm" "REG_SZ" $R0

; if it is an OF install, skip straight to theater admin otherwise, do RV stuff
StrCmp $F4subver "OF" TheaterAdmin

; this will be the area where we do stuff that it doesn't really matter which install it is
TheaterAdmin:
SetOutPath "$F4Root\Utilities"

; plus additional two lstupdate entries
ExecWait "$F4Root\Utilities\lstupdate.exe $F4ver +Theaters\${TNAME}\${TNAME}1.tdf"
ExecWait "$F4Root\Utilities\lstupdate.exe $F4ver +Theaters\${TNAME}\${TNAME}2.tdf"
ExecWait "$F4Root\Utilities\lstupdate.exe $F4ver +Theaters\${TNAME}\${TNAME}3.tdf"
ExecWait '$F4Root\Utilities\SPTinstall.exe -auto "$F4Root\Theaters\${TNAME}\terrdata"'
ExecWait "$F4Root\Utilities\LxNormalFix.exe $2"

; just compress textures if F4 then finish
StrCmp $F4ver "AF" Finish
ExecWait "$F4Root\Utilities\SeasonSwitcher.exe -0"

MessageBox MB_YESNO "Do you want to make the new theater the current one?" IDYES Finish IDNO OldReg
OldReg:
${registry::Write} "hklm\SOFTWARE\MicroProse\Falcon\4.0" "curTheater" "$3" "REG_SZ" $R0

Goto Finish

Error:
Messagebox MB_OK $ErrCode

Finish:

SectionEnd
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-09-19 20:41:33

I tested the htiles (htti* something) terrain rebuilder (SPTinstall) I got from Sherlock, it works fine now on AF-only computer. Thanks goes to Lamurt to do some testing and of course to Sherlock who sent me the terrain rebuilder.

But one fundamental question is, the hitiles are payware, is the htti terrain rebuilder... free for us to use or?
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-09-20 17:05:34

That's a good question. :/

Best case would be to check with whoever wrote it. Tom? LP?
Sic Semper tyrannosauro.

User avatar
Khronik
PMC Theater Developer
Posts: 51
Joined: 2006-05-02 22:01:01
Location: montreal quebec canada

Post by Khronik » 2007-10-05 19:43:45

Snake Man wrote:I tested the htiles (htti* something) terrain rebuilder (SPTinstall) I got from Sherlock, it works fine now on AF-only computer. Thanks goes to Lamurt to do some testing and of course to Sherlock who sent me the terrain rebuilder.

But one fundamental question is, the hitiles are payware, is the htti terrain rebuilder... free for us to use or?
Hey NP Snake Man.... LOL.

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Post by Sherlock » 2007-10-05 22:06:49

Khronik wrote:
Snake Man wrote:I tested the htiles (htti* something) terrain rebuilder (SPTinstall) I got from Sherlock, it works fine now on AF-only computer. Thanks goes to Lamurt to do some testing and of course to Sherlock who sent me the terrain rebuilder.

But one fundamental question is, the hitiles are payware, is the htti terrain rebuilder... free for us to use or?
Hey NP Snake Man.... LOL.
Yeh, the credit does need to go to Khronik, not to me. He was the one who originally suggested it in this thread early on. I just kept bringing it up because I have no life and, thus, more time on the forums! ;)
Sherlock
Victurous te Saluto

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-10-06 00:13:18

Yeah sorry didn't want to leave anyone out of the credits so thanks Khronik. But my point was Lamurt did the actual testing, Sherlock actually sent me the file, so that was the direct action in this mission so to speak.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-11-24 13:09:15

I emailed Tom Waelti and got his permission to use the HTTI terrain rebuilder, as it was also used in ODSAF v1.0 release I see no reason why PMC theaters could not use it.

So our installer problems are now gone, we'll implement HTTI terrain rebuilder and the installers work on all Falcon 4 installations :)

I think now as we have all those old theater releases, we should have the installer check for them and prompt for their deletion, T Rex already did this script part for NSIS and now I should implement it somehow. It was just bit complicated to cipher through all the stuff when I last time tried it out.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Post by Snake Man » 2007-11-26 10:04:36

I added bunch of stuff into PMC Editing Wiki: NSIS Installer page, check it out.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-11-27 03:15:59

Snake Man wrote:I think now as we have all those old theater releases, we should have the installer check for them and prompt for their deletion, T Rex already did this script part for NSIS and now I should implement it somehow. It was just bit complicated to cipher through all the stuff when I last time tried it out.
Let me know if I can help. :)

I've gotten a bit better even at this stuff. :thumbs:
Sic Semper tyrannosauro.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 8 guests