Archive: How to create a setup file that just enters registry keys?


How to create a setup file that just enters registry keys?
I want to create a setup file that just sets some registry keys that are defined by the user. It doesn't have to install any files and it should do the same as this .reg-file:

---------------------------------------------

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts]

[HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Games]

[HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Games\Generals]
"Language"="english"
"InstallPath"=">>>>E:\\Generals\\<<<<"
"MapPackVersion"=dword:00010000
"Version"=dword:00010006

[HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Games\Generals\ergc]
@=">>>>ENTER CD-KEY HERE<<<<"


---------------------------------------------

The user should change the values that are marked like this >>>>bla<<<<. The rest should just be written in the registry. I don't know how to create a plain registry-installer because NSIS always gives me an error when I try to enter the registry keys with the "WriteRegStr"-command:

Error: invalid script: never had OutFile command
Error - aborting creation process

And furthermore I have no idea how to create a user-prompt so that the user can change the 2 values I described above...


lol ...

You should place the

Outfile "Command_and_Conquer_Generals.exe"

outside a section


As explained by VegetaSan, you need a bit more to have a working NSIS script. Look at example1.nsi under the examples/ sub-directory where NSIS is installed.

BTW, if you just want to add keys in the Registry, you could just create a .REG file and ask users to double-click it. No need for a full-fledged installer.


yes i have a plain .reg-file for that (the text is quoted from one) but I want a more userfriendly way. And because two parameters have to be changed, i thought a installer would be nice


In this case, look at Contrib\InstallOptions for more infos on how to build some kind of form that prompts the user for more infos than just an install directory or an on/off choice.


mmm...
I didn't find anything. this is really hard because I know merley nothing about NSIS-scripting. I know a little of Inno-Setup but this is totally new for me...