You are here

Notepad++ Portable and NSIS Portable Integration

9 posts / 0 new
Last post
dagardner
dagardner's picture
Offline
Last seen: 5 years 4 months ago
Developer
Joined: 2007-09-20 14:41
Notepad++ Portable and NSIS Portable Integration

I want to start playing around with NSIS, so I downloaded NSIS Portable and downloaded the latest version of NSIS. While I was poking around on their Wiki, I found information about integrating NSIS with Notepad++. I thought, "Perfect!"

However, when I read the instructions, step two says "Verify that makensis.exe is in your environmental user path." How would I do this with portable versions of these programs? Is it possible?

I tried entering the full path to makensis.exe in step three, but that didn't seem to work.

Thank you,

Don

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 15 years 1 month ago
Joined: 2006-01-06 21:27
Well

Putting it in the path would make it non-portable.
Maybe contact the NSIS Portable author and see if you can get them to help you.

"If you're not part of the solution, you're part of the precipitate."

Deuce
Offline
Last seen: 14 years 2 months ago
Developer
Joined: 2005-12-24 16:32
It Can be done...

Using the NPPExec Plugin you can integrate NSIS portable...

The NPP Execute plugin has a variable for the NPP directory where the exe was run, so

$(NPP_DIRECTORY)\..\..\Compilers\NSIS\makensis.exe "$(FULL_CURRENT_PATH)"

Would tell it to run the makensis.exe file that was located two folders out of the NPP directory then into compilers\nsis\ directories. It can use relative paths to jump anywhere in the directory structure.

How to set it up:

1. Open NPP
2. Click Plugins --> NPPExec --> Execute
3. In the box fill in the command and path you want to run.
4. Click Save and give it a name.
5. It will then be save in the plugin settings. When you want to run, 2 things can be done.
a. Click on execute in the NPPExec plugin menu, from the drop down list choose
the command to run. Then Click ok.
b. After the first time it is chosen in the drop down, the nppexec plugin will
save that choice, you then just need to hit F6 to run the last use command.
So if you last used compile, you can recompile by type F6.
6. Lastly Make sure you have the OEM Console Output checked in the NPPExec menu, this will force output to the console at the bottom of the NPP window.

These are the coommandds I set up for NSIS integration on mine:

NSIS - Compile - $(NPP_DIRECTORY)\..\..\Compilers\NSIS\makensis.exe "$(FULL_CURRENT_PATH)"
NSIS - Help - $(NPP_DIRECTORY)\..\..\Compilers\NSIS\NSIS.chm

Granted the above commands would need to be changed for your directory structure. I have the program jump out two folders and then navigate back into two others to get to the NSIS files, that is just my directory structure. So you would need to change it for your structure.

Also the commands are then saved to a text file called "npes_saved.txt" in the NPP "Directory\Plugins\Config" Directory, so direct changing of the paths can be done there instead of within the NPPExec menu if you want.

I also have integrated most of the functions for Autoit, an they work well. Here is my Complete npes_saved.txt files for your use if you want, remember the paths will need to changed for use with your directory structure:


::AutoIt - Compile
$(NPP_DIRECTORY)\..\..\Compilers\Autoit\AutoIt3Wrapper\AutoIt3Wrapper.exe /in "$(FULL_CURRENT_PATH)" /autoit3dir "$(NPP_DIRECTORY)\..\..\Compilers\Autoit\"
::AutoIt - Run
$(NPP_DIRECTORY)\..\..\Compilers\Autoit\AutoIt3Wrapper\AutoIt3Wrapper.exe /in "$(FULL_CURRENT_PATH)" /autoit3dir "$(NPP_DIRECTORY)\..\..\Compilers\Autoit\" /run
::AutoIt - Syntax Check
$(NPP_DIRECTORY)\..\..\Compilers\Autoit\Au3check.exe "$(FULL_CURRENT_PATH)"
::AutoIt - Window Info Tool
npp_run $(NPP_DIRECTORY)\..\..\Compilers\Autoit\Au3Info.exe
::AutoIt - ScriptWriter
npp_run $(NPP_DIRECTORY)\..\..\Compilers\Autoit\ScriptWriter\AU3Record.exe
::AutoIt - Macro Generator
npp_run $(NPP_DIRECTORY)\..\..\Compilers\Autoit\AutoItMacroGenerator\AutoItMacroGenerator02.exe
::AutoIt - Tidy Up Script
 $(NPP_DIRECTORY)\..\..\Compilers\Autoit\Tidy\Tidy.exe "$(FULL_CURRENT_PATH)"
::AutoIt - Code Wizard
NPP_RUN $(NPP_DIRECTORY)\..\..\Compilers\Autoit\CodeWizard\CodeWizard.exe
::AutoIt - Form Designer
NPP_RUN $(NPP_DIRECTORY)\..\..\Compilers\Autoit\Koda\FD.exe
::AutoIt - Help (Word lookup)
NPP_RUN $(NPP_DIRECTORY)\..\..\Compilers\Autoit\Autoit3Help.exe $(CURRENT_WORD)
::AutoIt - Help
NPP_RUN $(NPP_DIRECTORY)\..\..\Compilers\Autoit\Autoit3Help.exe
::NSIS - Compile
$(NPP_DIRECTORY)\..\..\Compilers\NSIS\makensis.exe "$(FULL_CURRENT_PATH)"
::NSIS - Help
$(NPP_DIRECTORY)\..\..\Compilers\NSIS\NSIS.chm

Just copy the above and paste it into the npes_saved.txt file and changed the paths as needed to Autoit portable and NPP portable.

Hope this helps, let me know if you need any more help or if it doesn't work.

Deuce
Portable Software: Just the beginning.

dagardner
dagardner's picture
Offline
Last seen: 5 years 4 months ago
Developer
Joined: 2007-09-20 14:41
That did it

Your suggestion works like a charm.

You can also do the same thing with the Run menu. If you enter:

$(NPP_DIRECTORY)\..\..\Compilers\NSIS\makensis.exe "$(FULL_CURRENT_PATH)"

into the run menu, it works as well. The down side is that it runs in a separate window rather than in the console in Notepad++.

Thank you for your help,

Don

p.s. Dang it! I tried to do the help, but for some reason that didn't work. I am using the NSIS Portable and Notepad++ Portable, and I entered:

$(NPP_DIRECTORY)\..\..\..\NSISPortable\App\NSIS\NSIS.chm

The console says:

G:\PortableApps\Notepad++Portable\App\Notepad++\..\..\..\NSISPortable\App\NSIS\NSIS.chm
CreateProcess() failed
================ READY ================

I opened a command prompt in the Notepad++ directory (PortableApps\Notepad++Portable\App\Notepad++) and entered:

..\..\..\NSISPortable\App\NSIS\NSIS.chm

and the help opened right up, so the relative path is correct.

Any clue what might be wrong?

Thanks again!

Deuce
Offline
Last seen: 14 years 2 months ago
Developer
Joined: 2005-12-24 16:32
unforutnately....

The way the NPP extension works, it cannot open chm files. I have created a straight run link through the run menu to the left of the Plugins menu.

Just click Run, then Run Again, insert the command and the choose "Save", Give it a name and a optional key combo and then "ok"...

It will now show up in the run drop down list. and will work fine...

For me this is ok, because I don't run the help as much as I run the compiler...It will open the help just like if you type it into the help command. and oh, leave off the $(NPP_DIRECTORY) just as you did when you typed it into the command prompt.

Hope this helps...

Deuce
Portable Software: Just the beginning.

qwertymodo
qwertymodo's picture
Offline
Last seen: 12 years 4 months ago
Joined: 2008-03-17 19:08
Making chm files work

I found a way to make the .chm (or any file type, actually) work with the plugin. I wrote a small (84k) NSIS launcher that uses the ExecShell function to open any file with its default shell command, allowing you to use NPP extension because you tell the extension to run the .exe, which in turn opens the .chm. Unfortunately it's a bit slow, but that can't be helped. To use it, just name the .exe the same as the file you want to open, with a .exe at the end (e.g. to open the NSIS help file, NSIS.chm, compile the following code in NSIS and name the compiled program NSIS.chm.exe) and put it in the same folder as the original file, then just point the NPPExec extension at NSIS.chm.exe. I wrote it so it was simple and could be reused for ANY file, so there may be a way to make it not so slow, but probably less versatile. I think the slowness is caused by the NSIS ExecWait command, dunno. Hope this helps


!include FileFunc.nsh
!insertmacro GetBaseName

OutFile filename.ext.exe
SilentInstall Silent
RequestExecutionLevel user

Section
${GetBaseName} "$EXEDIR\$EXEFILE" $0
ExecShell "" "$EXEDIR\$0"
SectionEnd

Quamquam omniam nescio, nec nihil scio.

Deuce
Offline
Last seen: 14 years 2 months ago
Developer
Joined: 2005-12-24 16:32
Also, one more thing...

he procedure you found there, does not work with NSIS portable, as it uses the environmental variable of the machine, as such it must be installed to the machine..

The procedure I described above is the only way I found it works, as the NPPexec plugin does not use the enviro variables of windows but the enviro variables that NPP exec creates for itself on NPP run.

Again, hope this helps.

Deuce
Portable Software: Just the beginning.

wraithdu
Offline
Last seen: 11 years 5 months ago
Developer
Joined: 2007-06-27 20:22
You can still use

You can still use $(NPP_DIRECTORY) with the regular Run menu. That's the way I have NSISPortable set up. I prefer the Run method becuase I can assign keyboard shortcuts.

There is a problem (at least there was, I haven't tested it in a while) in the Run command that will not execute paths with spaces. You can try to wrap the command in " ", and if that doesn't work, writing out the 8.3 path/filename usually does.

qwertymodo
qwertymodo's picture
Offline
Last seen: 12 years 4 months ago
Joined: 2008-03-17 19:08
Is makensis.exe portable?

Anybody know if running the makensis.exe from a command-line would be inherently portable? I mean if I were to just copy the compiler .exe and the headers and plugins, etc., does the compiler itself leave stuff behind or is it just the nsis.exe editor that does that? If so, I have no need for NSIS Portable, I'd just copy the NSIS files over and use NPP. The way you're talking about linking like this, you seem to be ignoring the NSISPortable launcher anyways, so is there any reason to even install the portable version?

Quamquam omniam nescio, nec nihil scio.

Log in or register to post comments