Re-compile NSIs 2.46 source code in Windows

Source: Internet
Author: User
Tags wxwidgets

Recently, I am working on a NSIs installation program for Java, which involves classpath, but the path of-Cl is too long. The default NSIs string is only 1024 bytes long. I found it from the NSIs official website. In addition to 8192, special build also has a logset without combining the two. It is impossible to simply discard the uninstall function by install. log for 8192 bytes, so you have to manually compile the NSIs source code to meet your requirements.

According to the NSIs help document, to build NSIs, install Python and
Scons. The following are my installation steps. If you have your own compilation needs, you can use them as a reference.

1. Download the NSIs 2.46 source code zip package from the NSIs official website http://sourceforge.net/projects/nsis/files/, decompress to c: \ nsis-2.46-src.

2. Download Python 2.7.5 from the python official website http://www.python.org/getit/ (new version is not recommended to avoid scons not recognized) install to c: \ python27, add this path to the system path environment variable.

3. Download The http://sourceforge.net/projects/scons/files/ installation from the scons-2.3.0-setup on the scons official website (automatically default to the subdirectory of Python) and add the path c: \ python27 \ scripts to the system path environment variable.

4, because NSIs menu using wxWidgets writing, so go to The wxWidgets official website http://www.wxwidgets.org/downloads/ download wxWidgets-2.8.11.zip (do not try 2.9 series, otherwise wait for a variety of compilation warning various compilation errors) decompress to C: \ wxWidgets. Create an environment variable wxwin with the value of C: \ wxWidgets.

5. Before proceeding to the next step, make sure that your system has a visual C ++ 6.0 compiling environment, because the next step will require nmake to compile the NSIs menu (my machine also has the vs2010 environment, if you use it to compile the program, various errors will be reported.) Make sure that your system environment variables contain the bin directory of VC 6.0, such as c: \ Program Files \ Microsoft Visual Studio \ vc98 \ bin.

6. Enter the menu directory of NSIs, c: \ nsis-2.46-src \ contrib \ NSIs Menu \ wx, start wxbuild. bat on the command line, and compile the menu program first.

7, enter the NSIs directory c: \ nsis-2.46-src \ scons \ config, modify the MS file, will involve the OPT: nowin98 line all
# Comment out. There are four lines in total.

8, return to the NSIs home directory c: \ nsis-2.46-src, command line to start the command:

scons NSIS_CONFIG_LOG=yes NSIS_MAX_STRLEN=8192 dist-zip

Go out and smoke for 5-10 minutes. There will be a zip package in the NSIs main directory.

9. Copy the makensis.exe (not makensisw.exe) and stubs folders in the zip package. This is the final file you need. Drop them into your NSIs directory and overwrite the files with the same name. You can start compiling your NSIs installation script.

Note:

A. After scons is installed and added to environment variables, an error will be reported when scons is started on the command line:

scons: *** No SConstruct file found.File "C:\Python27\Lib\site-packages\scons-2.3.0\SCons\Script\Main.py", line 905, in _main

Don't be nervous. This is because the sconstruct file does not exist in the current path of your command line. The scons concept does not seem to allow you to empty-click the file name.

B. According to microsft, the OPT: nowin98 compilation option has been canceled since vs2005. However, even if you use VC 6.0 for compilation, an error is still reported, so you need to comment it out.

C. You can also specify the command line installation package in step 1 and install it directly to the specified path.

scons PREFIX="C:\Program Files\NSIS" install

However, this is not recommended.

D. The default NSIs package lacks many plug-ins.
Http://nsis.sourceforge.net/Category:Plugins to find a lot of useful stuff.

Note: Some problems are solved by referring to the http://forums.winamp.com/archive/index.php/t-277283.html.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.