Skip to content
⌘ NSIS Forum Archive

Newbie Trying to Write an Installer

2 posts

RyuichiYoshida#

Newbie Trying to Write an Installer

Hello!
I am very excited to attempt coding with the NSIS installer, but I guess I kinda got ahead of myself and am somewhat lost in trying to implement my code.

I am attempting to write an automatic installer for a 128gb ram patch for Windows XP, but I am not familiar with a lot of commands. I've tried referencing commands, but I am still falling short of understanding how to properly make the installer. I've spent almost 7 hours attempting this now, I think.

I established a specific outline of my plan, but I am just having a bit of trouble converting my pseudocode to actual code.

I need to take this step-by-step:
1. How can I make the NSIS installer menu say "You are installing the 128gb Ram Patch by Diyba?" I am aiming for the default menu that has a next and back button.
2. My installer will be taking two different folders of files. How can I make these files part of the installer file?
3. Once those two problems are solved, I must figure out how to set the default installation directory. How can I change the $INSTDIR's default location?
4. I also need to take a look at my code for the registry information; I am not too familiar with the whole thing and need to review the code there.

I tried skimming the chapters for NSIS, but I am still confused.
Anders#
1: I don't know whet you mean by "menu". The Modern UI has a welcome page if that is what you are talking about? Or perhaps the directory page?

2:
Section
SetOutPath "$InstDir"
File /r "c:\myfiles\*.*"

SetOutPath "$WinDir\Something"
File /r "c:\mywindowsfiles\*.*"
SectionEnd
3: InstallDir

4: Not sure what you mean.

You have "OutFile" twice in your script, only the last one is used.

You can check for x86 XP like this:

!include WinVer.nsh
!include x64.nsh
Function .onInit
${IfNot} ${IsWinXP}
${OrIfNot} ${IsNativeIA32} ; i386 32-bit
  MessageBox MB_ICONSTOP "XP only blah blah"
  Quit 
${EndIf} 
FunctionEnd