Archive: Sample Script for Game


Sample Script for Game
Hi,
i want to create a setup file for game with environment variable.

how to write a script for set environment variable and file name extension.
i need a sample code for game installer.
can u help me?

thanks in advance,
JAD


For environment variables, check out this wiki article

For setting file associations, look at this article. (There is a link at the bottom of this article to a NSIS forum article that explains in more detail.)

Both things above should be easy enough to implement as their both based on standard NSIS scripting (of which there are numerous examples included with the NSIS installation).


HI,
thanks.
i read that article and i did environment variables.
but i can't change the file extension.
i don't know why?

i wrote this for file extension
instaler section:
${registerExtension} "$INSTDIR\app.image" ".inst" "INST File"
uninstll section:
${unregisterExtension} ".inst" "INST File"

is this correct? or have to do anymore?

Thanks in Advance
JAD


hmm.. Did you read the linked forum article that I mentioned was on the wiki page?

It suggests that you call SHChangeNotify after changing the extensions.

There is a built-in macro include in the FileFunc header called "RefreshShellIcons" that does this very thing. For usage, refer to NSIS help, Appendix E. Try adding that to the end of the ${registerExtension} and ${unregisterExtension} lines in your script and see if that fixes.


HI ,
Thanks for your reply.
i wrote the code,whatever you mentioned.but still the file extension is not changed.

my code is,
instaler section:
${registerExtension} "$INSTDIR\app.image" ".inst" "INST File"
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'

uninstll section:
${unregisterExtension} ".inst" "INST File"
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'


have to do anything for change file extension?

Thanks,
JAD