Automating NSIS script build using maven2

放肆的年华 提交于 2019-12-18 03:46:56

问题


We have developed a script using NSIS Version 2.46 which would generate a installer for windows. Now that we would want to automate the build process of generating the installer by taking help of maven.

We currently use maven for building our java code projects and for building our end product.

For automating the build process of NSIS script, I am not able to find the maven plugin information which supports NSIS script build.

I googled for the information but I did not get any concrete information on how to start with it.

Could anyone explain how to start with it or point me to a page which explains about this with an example?


回答1:


Try this one from codehaus.

After you install or build 'makensis', you should be able to configure your pom to look something like this:

    <!-- Codehause Snapshots - Nsis plugin needs this -->
    <pluginRepository>
        <id>Codehaus Snapshots</id>
        <url>http://nexus.codehaus.org/snapshots/</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>  <!-- Workaround for MNG-2974, see note below -->
        </releases>
    </pluginRepository>

   <!-- NSIS plugin for producing nsis installer -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>nsis-maven-plugin</artifactId>
            <version>1.0-SNAPSHOT</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>generate-project</goal>
                        <goal>compile</goal>
                    </goals>
                    <configuration>
                        <makensisBin>/usr/local/nsis/nsis-2.46/bin/makensis</makensisBin>
                        <setupScript>src/nsis/setup.nsi</setupScript>
                        <outputFile>${project.build.directory}/${project.build.finalName}.exe</outputFile>
                    </configuration>
                </execution>
            </executions>
        </plugin>


来源:https://stackoverflow.com/questions/10352351/automating-nsis-script-build-using-maven2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!