1

I wrote a NSIS-script that creates an exe which creates a new folder and copies files into the folder. Is there a way to include the files into the exe?

Name "First Installer"
OutFile "firstinstaller.exe"
InstallDir C:\dev\NSIS\Scripts\FirstInstaller

Section "move test.exe"
    CreateDirectory $INSTDIR\test
    SetOutPath $INSTDIR\test
    CopyFiles $EXEDIR\test.txt $EXEDIR\test
SectionEnd

I now want to include the test.txt into the exe! Now you only have to start the exe and the test.txt is extracted from the exe into the created folder!

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
udo heinz
  • 23
  • 7
  • Possible duplicate of [NSIS - How to include all folders from source to Installer](https://stackoverflow.com/questions/7973242/nsis-how-to-include-all-folders-from-source-to-installer) – underscore_d Sep 12 '17 at 09:05
  • In my nsis installation program used ' File "D:\2003\WindowsServer2003-KB942288-v4-x64.exe" ' to include external exe in setup. Also used same code to add dll in project. – Jaimesh Sep 12 '17 at 09:18
  • define what you tried so i can help you. – Jaimesh Sep 12 '17 at 09:20
  • I see no `File` parameter there. You said you'd already tried that and it didn't work. Did you really? _What_ did you try? You should include all this kind of info in your question so that people don't tell you things you already discounted, or so they can point out other details, etc. – underscore_d Sep 12 '17 at 09:25

1 Answers1

3
Name "First Installer"
OutFile "firstinstaller.exe"
InstallDir D:\dev\FirstInstaller
Section "move test.exe"
;CreateDirectory $INSTDIR\test
SetOutPath $INSTDIR\test      ; extract exe content at this path, you can also specify other path 
File  /r "D:\dev\test.txt"    ;used to include file in exe
SectionEnd
Jaimesh
  • 841
  • 4
  • 25
  • 41