Page 1 of 7 123456 ... LastLast
Results 1 to 20 of 123
  1.    #1  
    With all of the scripts being generated we need to discuss some standards and best practices that we should be following to avoid chaos.

    Some rules I've been following.

    1) Install simple scripts to \Windows\Start Menu\Programs\MortScript. If there is more than one script involved either create a subfolder and put it in there or make a cab installer to install like a regular app under \Program Files.
    Scripts or shortcuts to scripts under \Windows\Start Menu\Programs\* can be set to buttons and started via voice command.
    If you have a super duper script that you think needs special attention link it in the Programs folder and give it a nice icon.

    2) Always get the current script path using SystemPath( "ScriptPath" ) when calling dependent scripts so that your scripts can be moved anywhere and still work.

    I'm flexible on 1 if someone has a better idea. I don't like putting scripts in the \Program Files\MortScript folder or below. For the more elaborate applications with a cab install it should be installed under \Program Files in its own folder like a regular app with links back to the Programs folder.

    Table of Contents
    1) Script icons
    http://discussion.treocentral.com/sh...75&postcount=4
    http://discussion.treocentral.com/sh...4&postcount=81

    2) Cab template
    http://discussion.treocentral.com/sh...87&postcount=5

    3) App delivery practices
    http://discussion.treocentral.com/sh...8&postcount=34

    4) Where to put registry values for your app
    http://discussion.treocentral.com/sh...3&postcount=56

    5) We Must Support Mort!
    http://discussion.treocentral.com/sh...&postcount=111

    6) Cab installs to storage card tips and tricks
    http://discussion.treocentral.com/sh...&postcount=113
    Last edited by hannip; 05/27/2007 at 12:41 PM.
  2. #2  
    Sounds good to me
    Palm III > HS Visor > Treo 600 > Treo 650 > Treo 750 > Treo Pro > PrePlus GSM

    "95% of all software issues are due to USER ERROR."
  3. #3  
    Sounds great.
  4.    #4  
    Now that we know how to make resource files containing icons should we share a common resource file between our scripts or have separate resource files?

    I had envisioned a shared ScriptIcons.dll resource file containing the icons for scripts with installers that could be versioned by setting a registry field such as this.

    [HKLM\Software\Mort's MortScript]
    ScriptIconsVersion 8

    Mort in his infinite wisdom provided a setup.dll to be used in cab installs. I propose we use an install/uninstall template for our scripts. Attached below is a cab template that I propose we use for our installs.

    Intructions for use:
    1) download ScriptIcons.cab
    2) change the name to <your app name>.cab
    3) change the app name and install dir in the cab. The install dir should be unique to your application such as \Program Files\<your app name>
    4) replace the ScriptIcons.dll in the cab with the latest version for your app.
    5) add your scripts, shortcuts, etc to the cab.
    6) edit the install.mscr to set the iconVersReq to the version number needed by your app. The version number will be an incrementing integer value each time new icons are added to ScriptIcons.dll. Add any additional customizations to the install.mscr and uninstall.mscr as needed and replace the ones in the cab with yours.
    7) save your cab, test, and zip up to make it available.

    Code:
    # install.mscr - Used for post processing of a cab installation
    # Notes:
    # - Requires MortScript's setup.dll to be used by the cab.
    # - MortScript.exe must be installed in the %installDir% along with this script
    # 
    
    # what is our path?
    instPath = SystemPath( "ScriptPath" )
    
    # check if icon resource needs updating?
    iconFile = "ScriptIcons.dll"
    iconVersReq = 8
    iconVers = 0
    iconRefCount = 0
    
    If ( FileExists( instPath \ iconFile ) )
       If ( FileExists( "\Windows" \ iconFile ) )
          If ( RegValueExists( "HKLM", "Software\Mort's MortScript", "ScriptIconsVersion" ) )
             iconVers = RegRead( "HKLM", "Software\Mort's MortScript", "ScriptIconsVersion" )
             iconRefCount = RegRead( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount" )
          EndIf
    
          If ( iconVers < iconVersReq )
             Copy( instPath \ iconFile , "\Windows" \ iconFile, 1 )
             RegWriteString( "HKLM", "Software\Mort's MortScript", "ScriptIconsVersion", iconVersReq )
          EndIf
    
          iconRefCount = iconRefCount + 1
          RegWriteDWord( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount", iconRefCount )
       Else
          Copy( instPath \ iconFile , "\Windows" \ iconFile, 1 )
          RegWriteString( "HKLM", "Software\Mort's MortScript", "ScriptIconsVersion", iconVersReq 
          RegWriteDWord( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount", 1 )
       EndIf
    EndIf
    
    Delete( instPath \ iconFile )
    	 
    
    ShowWaitCursor
    
    # Insert customizations here
    
    HideWaitCursor

    Code:
    # uninstall.mscr - Used for pre processing of a cab uninstall
    # Notes:
    # - Requires MortScript's setup.dll to be used by the cab.
    # - MortScript.exe must be installed in the %installDir% along with this script
    # 
    
    # what is our path?
    instPath = SystemPath( "ScriptPath" )
    
    # check if icon resource needs to be deleted.
    iconFile = "ScriptIcons.dll"
    
    If ( FileExists( "\Windows" \ iconFile ) )
       If ( RegValueExists( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount" ) )
          iconRefCount = RegRead( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount" )
          
          iconRefCount = iconRefCount - 1
    
          If ( iconRefCount <= 0 )
             Delete( "\Windows" \ iconFile )
             RegDelete( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount" )
             RegDelete( "HKLM", "Software\Mort's MortScript", "ScriptIconsVersion" )
          Else
             RegWriteDWord( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount", iconRefCount )
          EndIf
       EndIf
    EndIf
    	 
    
    ShowWaitCursor
    
    # Insert customizations here
    
    HideWaitCursor
    Attached Files Attached Files
    Last edited by hannip; 08/10/2007 at 07:47 PM. Reason: Version 8
  5.    #5  
    Here is the Treo Keylight cab utilizing the new cab template with customized install/uninstall scripts and shortcut with icon.

    This cab has a cool feature in that it doesn't need a separate MortScript install. It also demonstrates how to create a special shortcut that uses the ScriptIcons.dll.

    This is posted here so that it can be used as an example for other cab installs.

    Code:
    # install.mscr - Used for post processing of a cab installation
    # Notes:
    # - Requires MortScript's setup.dll to be used by the cab.
    # - MortScript.exe must be installed in the %installDir% along with this script
    # 
    
    # what is our path?
    instPath = SystemPath( "ScriptPath" )
    
    # check if icon resource needs updating?
    iconFile = "ScriptIcons.dll"
    iconVersReq = 4
    iconVers = 0
    iconRefCount = 0
    
    If ( FileExists( instPath \ iconFile ) )
       If ( FileExists( "\Windows" \ iconFile ) )
          If ( RegValueExists( "HKLM", "Software\Mort's MortScript", "ScriptIconsVersion" ) )
             iconVers = RegRead( "HKLM", "Software\Mort's MortScript", "ScriptIconsVersion" )
             iconRefCount = RegRead( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount" )
          EndIf
    
          If ( iconVers < iconVersReq )
             Copy( instPath \ iconFile , "\Windows" \ iconFile, 1 )
             RegWriteString( "HKLM", "Software\Mort's MortScript", "ScriptIconsVersion", iconVersReq )
          EndIf
    
          iconRefCount = iconRefCount + 1
          RegWriteDWord( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount", iconRefCount )
       Else
          Copy( instPath \ iconFile , "\Windows" \ iconFile, 1 )
          RegWriteString( "HKLM", "Software\Mort's MortScript", "ScriptIconsVersion", iconVersReq 
          RegWriteDWord( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount", 1 )
       EndIf
    EndIf
    
    Delete( instPath \ iconFile )
    	 
    
    ShowWaitCursor
    
    # install the applicable shortcut
    
       CreateShortcut( "\Windows\Start Menu\Programs\Keylight.lnk",\
          """" & instPath \ "MortScript.exe"" """ & instPath \ "Treo Keylight.mscr""?ScriptIcons.dll,-108" )   
    
    HideWaitCursor


    Code:
    # uninstall.mscr - Used for pre processing of a cab uninstall
    # Notes:
    # - Requires MortScript's setup.dll to be used by the cab.
    # - MortScript.exe must be installed in the %installDir% along with this script
    # 
    
    # what is our path?
    instPath = SystemPath( "ScriptPath" )
    
    # check if icon resource needs to be deleted.
    iconFile = "ScriptIcons.dll"
    
    If ( FileExists( "\Windows" \ iconFile ) )
       If ( RegValueExists( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount" ) )
          iconRefCount = RegRead( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount" )
          
          iconRefCount = iconRefCount - 1
    
          If ( iconRefCount <= 0 )
             Delete( "\Windows" \ iconFile )
             RegDelete( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount" )
             RegDelete( "HKLM", "Software\Mort's MortScript", "ScriptIconsVersion" )
          Else
             RegWriteDWord( "HKLM", "Software\Mort's MortScript", "ScriptIconsRefCount", iconRefCount )
          EndIf
       EndIf
    EndIf
    	 
    
    ShowWaitCursor
    
    # delete shortcut
    If ( FileExists( "\Windows\Start Menu\Programs\Keylight.lnk" ) )
       Delete( "\Windows\Start Menu\Programs\Keylight.lnk" )
    EndIf
    
    
    
    HideWaitCursor
    Attached Files Attached Files
    Last edited by hannip; 03/13/2007 at 07:17 PM. Reason: Uses renamed icon resource file and new method to create a shortcut
  6. #6  
    You are the best.Thanks for helping me out in my troubled day.
    Phil C
    Update,
    WOW!!!!! 1 cab install how sweet
    Last edited by slingbox; 03/04/2007 at 04:33 PM. Reason: update
  7. #7  
    hannip
    So are we looking at putting scripts in cab with mort files now and how are we going to work icons into?
  8.    #8  
    All scripts that follow this template will share the MortIcons.exe icon resource. Whenever we add a new icon for a new install we will increment the version number in the install script so that older installs don't backlevel the icon resource file.
  9. #9  
    right now the morticons has 2 icon for keylight should we decide on one icon.
  10.    #10  
    It's pointing to the first one now so yeah, we can replace the 2nd one with a new one for another app.
  11. #11  
    but i think slingbox like the second one better....
  12. #12  
    HOW SWEET!!!!!
    Im looking at contents of keylight cab and how very easy this will be.
    1)So we dont need are first version of mortscript on board if we follow cab with same install method.
    2)How do we add icon to the resource file.
  13.    #13  
    give me icons and I rebuild the resource with them.
  14.    #14  
    Quote Originally Posted by fearthefox View Post
    but i think slingbox like the second one better....

    lol, well keep it in there then so he can change his shortcuts.
  15. #15  
    I'm scared of the CAB. Does that make me a weenie?

    Seriously, there's good work goin on here. Question -- what if I wanted to bundle 30 or so voice-callable scripts into a single folder, say under the Windows\Start Menu\Programs\[MyNameHere] structure. Instead of the standard folder icon you get when a subdir is created as shown, I wanna create my own icon... let's say a folder with Mort's icon on it... This to keep my many scripts segregated for what reason I can't seem to justify past mere curiosity.

    If it's not a good idea, I can accept that, too. Just wanted to know how to do it.

    -- JDC
  16.    #16  
    Yeah, if you have a large bundle like that it makes sense for them to have their own folder. Just curious why a subfolder under the standard \Windows\Start Menu\Programs\MortScript folder could not be just as good since they are voice callable? I can see if you wanted to do it for easier access or if you are worried about hierarchy precedence issues.

    I mean if it's for your own use you can do whatever you like, but I'm worried that if everyone wants to create there own folder of scripts in the Programs folder it will fill up with folders quick.

    Then again if you aren't using a cab install and all of your scripts are path immune you could leave it to the installer to pick where to put them.
  17. #17  
    That's what worries me about the CAB install... It's like a dictator treading on my space... I don't know where the stuff will land (or tread) until after the install. Some CAB installs are so "good" I can never find where they went.

    The main reason others might want a folder of "my own" is to serve as a temp directory to test my stuff. if they like 'em, they can move to a std scripts folder. Plus, I have so many apps under the "PROGRAMS" structure, in addition to scripts and shortcut .lnk, that a subfolder as described works out nicely. See attached. What's so special about the Games Folder (icon)? All I did was create a Folder called "Games".

    -- JDC
    Attached Images Attached Images
  18.    #18  
    Yeah, I don't know how to get an icon on the folder like that. hmm.

    As I suggested to Slingbox in a PM I think we only want a cab install for our popular scripts to make it easy for the mass public to consume. Like Treo Keylight, your new XCast app, TreoVibe etc. For a group of voice activated scripts I think it's best to just let the user pick and choose which ones they want to copy to the device. If some become wildly popular we can always cab them up later.

    Wooohooo! this post was my 2,000 post at treo central.
  19. #19  
    Quote Originally Posted by hannip View Post
    Yeah, I don't know how to get an icon on the folder like that. hmm.

    As I suggested to Slingbox in a PM I think we only want a cab install for our popular scripts to make it easy for the mass public to consume. Like Treo Keylight, your new XCast app, TreoVibe etc.
    .. agreed

    Quote Originally Posted by hannip View Post
    For a group of voice activated scripts I think it's best to just let the user pick and choose which ones they want to copy to the device. If some become wildly popular we can always cab them up later.
    ... also agreed, but still curious about the icon thingie.

    Quote Originally Posted by hannip View Post
    Wooohooo! this post was my 2,000 post at treo central.
    Congrats (if you percieve it as an honor).

    BTW, you're averaging slightly over 150 posts per month... I've really only been contributing for about a month and am slightly over 150. At what point last year did your brain begin consuming itself from the inside out?

  20.    #20  
    I just noticed that uninstalling MortScript eats our icon version info. I'll change the install/uninstall script to move them elsewhere. Will post tonight.
Page 1 of 7 123456 ... LastLast

Posting Permissions