Jump to content
Sign in to follow this  
Flumon

Autodetect Flashpoint-Folder for Installer

Recommended Posts

Hey guys,

I'm looking for a way to revive the flashpoint-spirit of some of my friends. At Lan-Parties, when i suggest to play flashpoint, some of the guys say that flashpoint has too old graphics and is always the same. Then I tell that there are TONS OF GREAT ADDONS and you simply have to install some to highly improve gameplay. Manually installing is very time intensive but what about a SIMPLE INSTALLER?!

Then I grabbed Nullsofts Install-System(v2) and made a good installer with just the right addons and missions. Now I want the installer to autodetect the user's flashpoint-folder to which the addons/missions will be installed.

On Winterofp.com you can download a similar installer that is just like i want mine and it CAN DETECT the Flashpoint Folder.

I think it must be something like that

InstallDir "$PROGRAMFILES\Flashpoint"

or

InstallDir "$OFP"

Can anybody help me please?

Share this post


Link to post
Share on other sites

AFAIK, the only way to detect the OFP directory is by reading the registry key containing it. I don't know the installer you're using, but e.g. Installshield has the ability to read out this registry key and then use it to install addons in the proper directory.

Share this post


Link to post
Share on other sites
Hey guys,

I'm looking for a way to revive the flashpoint-spirit of some of my friends. At Lan-Parties, when i suggest to play flashpoint, some of the guys say that flashpoint has too old graphics and is always the same. Then I tell that there are TONS OF GREAT ADDONS and you simply have to install some to highly improve gameplay. Manually installing is very time intensive but what about a SIMPLE INSTALLER?!

Then I grabbed Nullsofts Install-System(v2) and made a good installer with just the right addons and missions. Now I want the installer to autodetect the user's flashpoint-folder to which the addons/missions will be installed.

On Winterofp.com you can download a similar installer that is just like i want mine and it CAN DETECT the Flashpoint Folder.

I think it must be something like that

InstallDir "$PROGRAMFILES\Flashpoint"

or

InstallDir "$OFP"

Can anybody help me please?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

InstallDirRegKey HKLM \

"SOFTWARE\Codemasters\Flashpoint Resistance" \

"MAIN"

Share this post


Link to post
Share on other sites

NSIS is a great install system wink_o.gif I like it.

Here's part of the code I used

Quote[/b] ]Function .onInit

ReadRegStr $INSTDIR HKLM "SOFTWARE\Codemasters\Flashpoint Resistance" "MAIN"

IfErrors 0 end

MessageBox MB_YESNO "Game is notinstalled. Continue ?" IDYES yes IDNO no

yes:

MessageBox MB_OK "You will have to specify OFP directory"

Goto End

no:

Abort

end:

FunctionEnd

InstallDir "$INSTDIR"

...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×