Menu

Using Notepad++ from an USB stick

2005-04-13
2012-11-13
  • Jan Steinhardt

    Jan Steinhardt - 2005-04-13

    Hi, it would be nice if it would be possible to put the complete Notepad++ directory on an USB stick without having anything in the user's %AppData% directory.

    At the moment, there is no way to put the nativeLang.xml in the application directory. I've the settings path to the application directory in parameters.cpp. This solution works for me but I think it would be useful to other users as well.

    I can send you the changed parameters.cpp but I didn't provide an option to select %AppData% or the application directory and my changes are very little (less than 10 lines of code).

    - Jan -

     
    • Don HO

      Don HO - 2005-04-14

      OK, I'll treat "nativeLang.xml" as "styles.xml" and "config.xml" -
      if "nativeLang.xml" is not in "%AppData%\Notepad++" directory, the current directory where is Notepad++.exe will be searched. If it is found, it'll be copied into the "AppData%\Notepad++" directory and loaded.

      Don

       
    • Jan Steinhardt

      Jan Steinhardt - 2005-04-15

      I've used SciTE for a long time before I found Notepad++. I like all the new features. One reason to use SciTE was that is does not need anything on the user's machine but it's own application directory which contained everything to run and customize SciTE.

      It would be nice if you provide this feature in Notepad++. I think many users will need it.

      - Jan -

       
    • Nobody/Anonymous

      This is the only reason i DON'T use notepad ++.
      I hate programms using registry or save data around the user profile, please fix this or at least give use the option to decide e.g. with a commandline option or something like:

      If exists "default-styles.xml" and "default-config.xml" use this instead the %appdata% crap.

      btw. Notepad++ is one of best tools ever seen.

      - Maybe a user in the future -

       
    • Nobody/Anonymous

      Support for this would be great!

       
      • Don HO

        Don HO - 2005-07-24

        the behaviour that Notepad++\nativeLang.xml is loaded as the absence of %AppData%\Notepad++\nativeLang.xml
        will be in v3.2.

        Don

         
    • Nobody/Anonymous

      Please support all the settings in the installation directory itself.

       
    • Nobody/Anonymous

      V3.2 is not out and this great editor is still not usb stick ready. Why is this so complicated to build in?

      There are several solutions that works for years on other applications, why not in np++?

      There are 2 simple solutions:
      1. np++ should check for e.g. a usbstick.ini/xml and if it presents use all files in the np++ directory.
      2. np++ should check if there a usb-config.xml intead of config.xml (an for all other files too)

      Why are such simple checks not possible to build in? why i must leave all config data on every computer i use np++ from a portabel drive?

       
    • Nobody/Anonymous

      Where is this "nativeLang.xml" of which you speak?

       
    • Stuart Colville

      Stuart Colville - 2005-09-08

      The suggestions above would also help with setting up notepad++ to work under wine.

       
      • Don HO

        Don HO - 2005-09-14

        OK.

        It'll be possible to read/write all xml file in the N++ directory :
        An argument "-localConf" (if you have a better name, please let me know) will be added in the next release to trigger this behaviour.

        Don

         
    • Nobody/Anonymous

      something like "-localConf" would be fine. thanks for that.

       
    • Chris Severance

      Chris Severance - 2005-09-17

      I don't like command switches for this purpose. I like trigger files. Just place a 0-length file of a certain name in the Notepad++.exe folder and the behaviour changes. That way when you need the editor, you simply run it without knowing what switch does what.

       
      • Nobody/Anonymous

        Hmm, it s not a bad idea.
        However, I should look into the code to see if it s possible - i m not able to reach it since I m on holiday.

        If it s possible, which file name do you suggest ?

        Don

         
    • Nobody/Anonymous

      Hi there,

      whats the problem by simpling reading the native "nativeLang.xml" from the N++ directory, without copying it into %appdata%?
      I just don't get it.

      Marco

       
    • Per

      Per - 2005-10-12

      Let me just add that I too think it would be a great idea if N++ could run entirely from its own directory - but I would also add I understand that the programmer probably has a lot of other things to do, so we should be patient :) At least he didn't tell us to go away :)

       
    • Paulius

      Paulius - 2005-10-13

      Just a thought. Has anyone tryed this:
      Lets say you have USB stcik assigned drive letter X:\

      Step one:
      Notepad++ is unziped to X:\Notepad++ folder - that is NPP executable file path is: X:\Notepad++\notepad++.exe.

      Step two:
      In Notepad++ folder you create BATCH file (bot or cmd) and place following lines in that file:
      @echo off
      set saved_appdata=%APPDATA%
      set APPDATA=..
      notepad++.exe
      set APPDATA=%saved_appdata%
      set saved_appdata=

      Step three:
      You use that cmd file to start Notepad++

      Result:
      Notepad++ will think that %APPDATA% path is X:\Notepad++\.. wich means that it will look for all those XML files in X:\Notepad++\..\Notepad++ folder wich is the folder where notepad++.exe is located.

      I'd try this solution myself, but unfortunately i don't have USB stick. So if anyone tryes this, please tell everyone if it worked or not.

      PS: there is one dissadvantage to this - batch file must be started from Notepad++ folder because it contains relative paths (wich is necessary, because on different computers drive letter assigned to your USB stick might be different).

       
    • Nobody/Anonymous

      Paulius because its too much bother. If Notepad++ didn't have a certain air about it, I would have moved on along time ago - as it is, I'll just pester the author to store the configs in the install directory.

      Then he can get his listing back on http://www.portablefreeware.com :)

       
    • Paulius

      Paulius - 2005-10-16

      Why don't you download the sources and try to fix that behaviour yourself?
      I don't need it - i won't do it. I just had a simple idea, that *might* work so i shared that idea with you guys.

      Another idea would be to make a batch script or executable file that, when started, would copy all the configuration files from it's directory to %APPDATA%\Notepad++ folder, and then it would start Notepad++, then it would WAIT FOR Notepad++ to finish (i believe you can pass process handle to WaitForSingleObject), when that happens - you copy the files back (and probably remove them from %APPDATA%).

      It isn't that hard to implement.

      Good luck!

       
    • Chris Severance

      Chris Severance - 2005-10-17

      I think the best solution is for N++ to look in it's setup directory first and the %APPDATA% directory second. If I move the config files to the N++ folder, they are used there from then on. The config files are the trigger files and any one or all of them can be moved.

      This also means that plugin authors need to do the same.

       
      • Don HO

        Don HO - 2005-10-17

        This feature is done on v3.3 which will be released in a couple weeks.

        The trigger is an empty file (length 0) "doLocalConf.xml" which should be located in the same directory as notepad++.exe. In the case of absence of this file, notepad++.exe will look for its xml files in %APPDATA%\Notepad++ directory.

        Chris is right about the plugins' config files :
        plugin authors should respect this rule, otherwise something terrible will happen.

        Don

         
    • Paulius

      Paulius - 2005-10-17

      Damn... I haven't thought about plugins...
      Anyway, both of my suggestions should work without any changes to original npp source or any plugin source.

       
    • Nobody/Anonymous

      That is very excellent news. I like your great work.

       
    • Nobody/Anonymous

      For the past few months I've been using the following batch file which is in the directory where notepad++ resides on my USB stick:

      xcopy "Notepad++" "%AppData%\Notepad++\" /s /y
      notepad++.exe
      xcopy "%AppData%\Notepad++\*.*" "Notepad++" /s /y
      rmdir "%AppData%\Notepad++\" /s /q

      Can't wait for v3.3 to come out so that I can get rid of the batch file and other editors that I have used :)

       
    • Nobody/Anonymous

      GREAT NEWS!
      N++ as a true ''stand-alone'' app!