Archive: Is it possible not to embed all files in exe


Is it possible not to embed all files in exe
Hello,

I am trying to prepare a setup with nsis. My setup files' total size is nearly 300MB. So I don't want to embed all files in setup exe. Instead I want to call them externally and copy them to the install directory during installation. Is there a way to this in nsis and how?

Thanks in advance.


Use CopyFiles instead of File in your install.

[/SILENT] [/FILESONLY] filespec_on_destsys destination_path [size_of_files_in_kb]


Thanks scully :)

I am not so clear how to use this command. My install section is like below. Can you give an example how to I do this?

Section "Main Istall" MainInstall

SetOutPath "$INSTDIR"

;Copy Project Files
File "dummy1.exe";
File "dummy2.exe";
File "dummy3.txt";

;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"

;Create start menu shortcuts
CreateDirectory "$SMPROGRAMS\MyPrg"
CreateShortCut "$SMPROGRAMS\MyPrg\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
CreateShortCut "$SMPROGRAMS\MyPrg\MyPrg.lnk" "$INSTDIR\dummy1.exe"

;Create desktop shortcuts
CreateShortCut "$DESKTOP\MyPrg.lnk" "$INSTDIR\dummy1.exe"

SectionEnd


Something like this:

SetOutPath "$INSTDIR"

;Copy Project Files
CopyFiles "$EXEDIR\dummy1.exe" "$INSTDIR"
CopyFiles "$EXEDIR\dummy2.exe" "$INSTDIR"
CopyFiles "$EXEDIR\dummy3.txt" "$INSTDIR"

You should read the paragraph in the documentation though about the /SILENT and /FILESONLY flag because you can also use CopyFiles to just copy an entire directory. So, you may not want the Windows copy dialog popping up on you. You can also put the size on the end of the line.

CopyFiles /SILENT /FILESONLY "$EXEDIR\file.exe" "$INSTDIR" 0


Thanks scully13 ;)

It is ok.