Loading ...
Sorry, an error occurred while loading the content.

RE: [Clip] How to establish default folders#2

Expand Messages
  • John Shotsky
    Thanks, Art, You ve done a nice job of setting this all up. The extra effort is appreciated. I ll be out most of today, but will look at implementation later
    Message 1 of 2 , Nov 19, 2009
    • 0 Attachment
      Thanks, Art,

      You've done a nice job of setting this all up. The extra effort is appreciated.

      I'll be out most of today, but will look at implementation later or tomorrow.



      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Art Kocsis
      Sent: Thursday, November 19, 2009 7:06 AM
      To: NoteTab-Clips
      Subject: RE: [Clip] How to establish default folders#2

      Sorry. My bad. This bounced because I sent it out by the wrong address.

      Hi John,

      As I said before I think you are heading for trouble if you try messing
      around with NTB's folder locations - especially when there are much easier
      ways of accomplishing your goals. As I understand it you want to install an
      app that uses NTB clips in such a way that it is painless to your users and
      minimizes your support requirements. To do this you need to install/update
      your clip library into NTB's Library folder and to install another set of
      files into a known, easily located root folder. Correct? You haven't said
      how you distribute the files - ZIP file, downloaded from links, email
      attachments, whatever -but that is a separate issue.

      Looking over NTB's folder locations on my system under various conditions
      they seem to be all over the place (see previous post), except for the NTB
      application folder. So I can understand why you would want to install your
      data folder there. However, that IMHO is not a good location. I, for one,
      do not like to clutter up an app with all the data files, especially when
      they could be associated with quite disparate projects. In addition, many
      projects involve multiple applications which makes organizing by project
      rather than application much more logical. And it is a good idea to
      separate data from applications to facilitate backup operations.

      There are numerous easily located "standard" places besides the NTB app
      folder under which you could install your files: The ubiquitous "My
      Documents" [^$GetShellFolder(Personal)$], the desktop
      [^$GetShellFolder(Desktop)$], even create your own: C:\ShotskyRcp\ as well
      as give the choice to your user. Any of these choices can be saved in your
      INI file without the user having to know where it physically is located.
      Using NTB functions to locate your files would achieve your goals even if
      the files are in different locations for different systems. All you really
      need is for NTB to know where they are for a specific installation. Your
      users do not have to know or figure out where to put things, especially the
      .clb file.

      Below is some prototype code that will install/update your files into
      known, easily controlled default locations yet still give the user freedom
      to choose a different location. Starting with your distribution files in a
      known location, it moves (or copies), the clip library files to the NTB
      clip library, defines a default root location for your data files (with
      optional user over ride), copies (moves) the data files to the selected
      folder structure and saves the locations in a custom application INI file.
      The root location is retrieved from the INI file for normal usage.
      Obviously, the code needs to be customized for your app.

      For further automation you could ZIP your files into an SFX file that would
      create a link on the user's desktop and, in turn, launch NTB and the
      installation clip. If you want further help send me your distribution so I
      have the specifics of what you want to do.

      Namaste', Art

      ;############# Clip code follows ######################
      ^!Toolbar New Document
      ^!Set %default%=C:\ShotskyRcp\
      ^!Set %default%=^$GetShellFolder(Personal)$ShotskyRcp\
      ^!Set %default%=^$GetShellFolder(Desktop)$ShotskyRcp\
      ^!Set %default%=^$GetAppPath$
      ^!Set %default%=^$GetDataPath$
      ^!Set %default%=^$GetDocumentPath$
      ^!Set %default%=whatever!!!
      ^!SetIniFile RcpClipLib
      ^!Set %root%=^$GetValue("root")$ [distributed INI
      file contains null value]
      ^!IfEmpty ^%root% ^!Set %root%=^%default%
      ^!Set %root%=^?{(T=D)Accept or change full path to root
      folder=^%root%} [User can change dir]
      ^!IfEmpty ^%root% Skip_-1
      ^!IfPathExist "^%root%" Next ELSE ^!Goto Skip_-2
      ^!SaveValue root=^%root%

      ;Clip to move files to user created NoteTab Folders ARK/11-18-09
      ;^!MkDir DirName [no error if DirName pre-exists]
      ;^!TextToFile [FilePath]FileName Any text [Creates dest folder if not exist]
      ;^!CopyFile "FileSpecs" "Destination" [fails if dest folder not exist]
      ;^!MoveFile "FileSpecs" "Destination" [fails if dest folder not exist]

      ;This section is just for testing purposes
      ^!Set %tmpPath%=^$GetTmpPath$
      ^!InsertText ^%NL% Create dummy test files in: ^%tmpPath%^%NL%
      ^!TextToFile "^%tmpPath%RcpClipLib.clb" This is dummy RcpClipLib.clb
      ^!TextToFile "^%tmpPath%RcpClipLib.ctb" This is dummy RcpClipLib.ctb
      ^!TextToFile "^%tmpPath%RcpClipLib.ini" This is dummy RcpClipLib.ini
      ^!TextToFile "^%tmpPath%RcpClipLib.bmp" This is dummy RecipeApps.bmp
      ^!TextToFile "^%tmpPath%RcpClipLib.ico" This is dummy RecipeApps.ico
      ^!TextToFile "^%tmpPath%RecipeApps.dat" This is dummy RecipeApps.dat
      ^!TextToFile "^%tmpPath%RecipeApps.doc" This is dummy RecipeApps.doc
      ^!TextToFile "^%tmpPath%RecipeApps.rcp" This is dummy RecipeApps.rcp
      ^!TextToFile "^%tmpPath%RecipeApps.txt" This is dummy RecipeApps.txt
      ^!TextToFile "^%tmpPath%RecipeApps.hta" This is dummy RecipeApps.hta
      ^!TextToFile "^%tmpPath%RecipeApps.tpl" This is dummy RecipeApps.tpl

      ^!Set %srcPath%=^%tmpPath% [actual location of distribution files]

      ^!Set %libPath%=^$GetLibraryUserPath$
      ^!InsertText ^%NL% Move Clip lib files to: ^%libPath% ^%NL%
      ^!MoveFile "^%srcPath%RcpClipLib.clb" "^%libPath%"
      ^!MoveFile "^%srcPath%RcpClipLib.ctb" "^%libPath%"
      ^!MoveFile "^%srcPath%RcpClipLib.ini" "^%libPath%"
      ^!MoveFile "^%srcPath%RcpClipLib.bmp" "^%libPath%"
      ^!MoveFile "^%srcPath%RcpClipLib.ico" "^%libPath%"
      ^!IFError ^!InsertText copy failed: RecipeApps.ico ^%NL%

      ^!Set %datPath%=^$GetDataPath$
      ^!InsertText ^%NL% Create Support & data folders under: ^%datPath% ^%NL%
      ^!MkDir "^%datPath%RecipeApp"
      ^!MkDir "^%datPath%RecipeApp\Help\"
      ^!MkDir "^%datPath%RecipeApp\Recipes\"
      ^!MkDir "^%datPath%RecipeApp\Templates\"
      ^!InsertText Move Support & data files to sub-folders^%NL%
      ^!MoveFile "^%srcPath%RecipeApps.hta" "^%datPath%RecipeApp\Help\"
      ^!IFError ^!InsertText copy failed: RecipeApps.hta ^%NL%
      ^!MoveFile "^%srcPath%RecipeApps.dat" "^%datPath%RecipeApp\Recipes\"
      ^!IFError ^!InsertText copy failed: RecipeApps.dat ^%NL%
      ^!MoveFile "^%srcPath%RecipeApps.doc" "^%datPath%RecipeApp\Recipes\"
      ^!IFError ^!InsertText copy failed: RecipeApps.doc ^%NL%
      ^!MoveFile "^%srcPath%RecipeApps.rcp" "^%datPath%RecipeApp\Recipes\"
      ^!IFError ^!InsertText copy failed: RecipeApps.rcp ^%NL%
      ^!MoveFile "^%srcPath%RecipeApps.txt" "^%datPath%RecipeApp\Recipes\"
      ^!IFError ^!InsertText copy failed: RecipeApps.txt ^%NL%
      ^!MoveFile "^%srcPath%RecipeApps.tpl" "^%datPath%RecipeApp\Templates\"


      No virus found in this outgoing message.
      Checked by AVG - www.avg.com
      Version: 9.0.707 / Virus Database: 270.14.73/2512 - Release Date: 11/18/09 11:41:00

      [Non-text portions of this message have been removed]

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.