1

Assuming that it is possible to compress a file from within an NSIS script, what is the best way to accomplish that and what would be the actual statement?

Is there a built-in NSIS instruction for that?

Eternal Learner
  • 2,602
  • 5
  • 27
  • 38

1 Answers1

1

Your question does not really make a lot of sense, are you asking how to install a file, or are you trying to use NSIS as some sort of general file compression utility?

Here is a basic script that "installs" a file:

Outfile test.exe
Requestexecutionlevel user
Setcompressor LZMA
Page instfiles

Section
;Not a good idea to hardcode the destination like this, 
;normally you would use a directory page so the user can choose
SetOutPath "c:\SaveToThisFolder"

;Take thefile.txt from the system you compile on and output it on the end users system 
;into the directory specified by the SetOutPath call
File "thefile.txt"
Sectionend

If you are writing an actual installer for some application, you really should take a look at some of the examples that ship with NSIS

Anders
  • 97,548
  • 12
  • 110
  • 164
  • I am asking about the latter, trying to use NSIS to compress a file that was generated by NSIS (not really a general file compression utility). For example, compressing the text file that is produced by msinfo32: http://stackoverflow.com/questions/4597125/msinfo32-wont-run-in-nsis-under-windows-xp – Eternal Learner Jan 04 '11 at 22:08
  • 2
    @Eternal Learner: This will require external tools (7zip,pkzip etc), extract desired tool to $pluginsdir and use a plugin like nsExec to run it. – Anders Jan 04 '11 at 22:39
  • No problem. I just wanted to make sure that I am not missing an NSIS built-in function. – Eternal Learner Jan 05 '11 at 00:33