You are here

jEdit - could someone do an NSIS?

14 posts / 0 new
Last post
Nathan MacInnes
Offline
Last seen: 15 years 8 months ago
Joined: 2007-01-17 20:30
jEdit - could someone do an NSIS?

I've just come across this site, and it's great. I'm using a portable jEdit at the moment. Here's my method:

1. I copied the jEdit program files to E:\apps\jEdit.
2. I created a 'settings' directory in E:\apps\jEdit.
3. I created a shortcut with the target set as "E:\apps\jEdit\jedit.jar -settings=E:\apps\jedit\settings". This means that all jEdit settings, installed plugins, etc, are stored here, instead of the "system specific" default location.

The main problem with this method is that it's possible my USB drive won't be E on another computer. If that's the case, I'll have to change the shortcut accordingly.

I think this would be a good one to add to the list of official apps. It should be quite simple to do, I expect. I don't know if it being a Java app will make it any more difficult.

Edit: I realise my dir structure isn't the norm for PortableApps, so if someone wants to write the NSIS, change the settings directory.

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 13 years 4 months ago
Joined: 2006-01-06 21:27
Sure!

If you want a simple one,

OutFile "jedit.exe"
Section
       Exec "$EXEDIR\jEdit.jar -settings='$EXEDIR\settings'"
SectionEnd

If you want a full one, I'll make one for you.
----
Ryan McCue
Person 1: Oh my god. You will never believe what just happened.
Person 2: What?
Person 1: I can't remember, I've forgotten.

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

Nathan MacInnes
Offline
Last seen: 15 years 8 months ago
Joined: 2007-01-17 20:30
Thanks

The simple one suits me just fine. I can make a few modifications to that based on existing code without any problems if I do want to extend it. I think it'd be a nice addition to the project though (although I'm not really up to doing that) and if you think so too, then why not?

Nathan MacInnes
Offline
Last seen: 15 years 8 months ago
Joined: 2007-01-17 20:30
I've just fixed up the

I've just fixed up the simple one, and it doesn't seem to work. I compiled it and everything, and I just get the screen saying the install is complete (or nothing, when I added a SilentInstall statement). When I click on details, it lists the file as having been executed. I presume that's got something to do with it being a Java app. As far as Windows is concerned, jar files and other java files are just ordinary files run by a program (javaw.exe in jEdit's case), and so aren't executable in themselves.

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 13 years 4 months ago
Joined: 2006-01-06 21:27
Try

ExecShell which should open it with the default program which one would assume is Java.
----
Ryan McCue
Person 1: Oh my god. You will never believe what just happened.
Person 2: What?
Person 1: I can't remember, I've forgotten.

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

Nathan MacInnes
Offline
Last seen: 15 years 8 months ago
Joined: 2007-01-17 20:30
Thanks again

After a bit of research and some trial and error, I got it. In case anyone's wondering:

OutFile "jedit.exe"
Icon "jEdit.ico"
SilentInstall Silent
Section
       ExecShell "" "$EXEDIR\jedit.jar" "-settings=$EXEDIR\settings"
SectionEnd

-Nathan

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 13 years 4 months ago
Joined: 2006-01-06 21:27
Great!

I'm glad it worked out for you Wink
----
Ryan McCue
Person 1: Oh my god. You will never believe what just happened.
Person 2: What?
Person 1: I can't remember, I've forgotten.

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

lukescammell
Offline
Last seen: 12 years 3 months ago
Joined: 2007-01-25 05:30
Almost perfect

It works so long as you don't try and start it from a directory with a space in the name, otherwise it truncates the directory to the first space.

Is there a way to make it compatible with directories with spaces?

Thanks Smile

Nathan MacInnes
Offline
Last seen: 15 years 8 months ago
Joined: 2007-01-17 20:30
I see what you mean. I

I see what you mean. I haven't tested this out yet (I'm not a computer where I have admin rights to install NSIS), but a quick test using a shortcut showed that this should work. When jEdit is passed a directory that has a space in it, it should be surrounded with quotes... so your resulting NSIS file should look like this:

OutFile "jedit.exe"
Icon "jEdit.ico"
SilentInstall Silent
Section
       ExecShell "" "$EXEDIR\jedit.jar" "-settings=$\"$EXEDIR\settings$\""
SectionEnd
lukescammell
Offline
Last seen: 12 years 3 months ago
Joined: 2007-01-25 05:30
Perfect!

Now that's perfect! Thanks to everyone who contributed to this thread, but you especially Nathan. Now I can use my favourite dev environment on any machine I like (that has Java ;)).

Just for reference, with the Kris Kopicki & Gerd Knops icon my executable ends up at 57,087 bytes.

Nathan MacInnes
Offline
Last seen: 15 years 8 months ago
Joined: 2007-01-17 20:30
Cool

Yup 57,087.

It's nice to know that someone else is using it too. The Java thing is a problem though. Variations in Java versions between computers can cause some plug-ins not to work, and it isn't a graceful degradation, either. Still, it does the job most of the time.

scroipt
Offline
Last seen: 16 years 4 days ago
Joined: 2007-02-07 05:18
script calling java

For if there is no default action specified for .jar files.

OutFile "jedit.exe"
Icon "jEdit.ico"
SilentInstall Silent
Section
ExecShell "" "$%JAVA_HOME%\bin\java" "-jar $EXEDIR\jedit.jar -settings=$\"$EXEDIR\settings$\""
SectionEnd

This gives me a filesize of 41,248 B

ace_dent
Offline
Last seen: 13 years 9 months ago
Joined: 2005-12-13 10:08
Upload anyone?

Howdy.

Would anyone be prepared to upload their Portable jEdit?
I'm reluctant to start playing with NSIS...

Cheers,
Andrew

rolandd
Offline
Last seen: 15 years 4 months ago
Joined: 2007-05-08 04:47
I would love to work with

I would love to work with jEdit portable too. But how and where do I use the code mentioned above?

Thanks Smile

Topic locked