The i-Technology Media!
Register | Log in
   
 
.NET  ·  AJAX  ·  CLOUD  ·  ECLIPSE  ·  FLEX  ·  OPEN WEB  ·  iPHONE  ·  JAVA  ·  LINUX  ·  OPEN SOURCE  ·  ORACLE  ·  PBDJ  ·  SEARCH  ·  SILVERLIGHT  ·  SOA  ·  VIRTUALIZATION  ·  WEB 2.0  ·  WIRELESS  ·  XML
Comments
Google Wave Invitation Giveaway
By Aditya Banerjee
Timo Hirvonen wrote: I would really appreciate an invitation. Been desperately trying to find one :) timo [dot] hirvonen [at] gmail [dot]com
Nov. 27, 2009 11:13 AM EST
Cloud Expo on Google News
Did you read today's front page stories & breaking news?


2009 East
PLATINUM SPONSORS:
IBM
Smarter Business Solutions Through Dynamic Infrastructure
IBM
Smarter Insights: How the CIO Becomes a Hero Again
Microsoft
Windows Azure
GOLD SPONSORS:
Appsense
Why VDI?
CA
Maximizing the Business Value of Virtualization in Enterprise and Cloud Computing Environments
ExactTarget
Messaging in the Cloud - Email, SMS and Voice
Freedom OSS
Stairway to the Cloud
Sun
Sun's Incubation Platform: Helping Startups Serve the Enterprise
POWER PANELS:
Cloud Computing & Enterprise IT: Cost & Operational Benefits
How and Why is a Flexible IT Infrastructure the Key To the Future?
Click For 2008 West
Event Webcasts

2009 East
GOLD SPONSORS:
CA
Get Your Transactions Under Control: SOA Performance Management
Software AG
Performance Driven Adoption: The Secret to Advancing SOA
Intel
The Evolving SOA Appliance: 3 Game-Changing Innovations
SILVER SPONSOR:
Denodo
Data Mashups: Deliver Your Project Faster with Virtualized Data Services Across Internal & External Sources
POWER PANELS:
The Business Value of Service Orientation
Driving Profitability Through User Experience
Click For 2008 West
Event Webcasts
Live Google News by SYS-CON!
Top Three Links You Must Click On


Features
New Features in PowerBuilder 11.5
Part 1 – User Rights

By: Bruce Armstrong
May. 28, 2009 12:45 PM

I plan to make this the first of a series of articles that discuss the new features in PowerBuilder 11.5, which was released late last year. Of course, they won't be the first articles we've run on the topic, as we ran an article on the new Code Access Security features back even before 11.5 was released and a more recent article on New DataWindow Features. This series of articles is intended to discuss the major hitters of the remaining features.

FDCC Compliance
At the risk of putting my readers to sleep I'll cover the FDCC compliance first. Not because most PowerBuilder developers need or want this functionality, but because most PowerBuilder developers using PowerBuilder 11.5 are going to be affected by it nonetheless. What FDCC compliance gets at, viewed from a bigger perspective, is the issue of being able to run applications in an environment where the user has restricted user rights. It's something I deal with regularly with the applications I end up writing, because many of them are used in environments where the end user has limited rights on the workstation.

For example, in many cases the user does not have permission to write entries into most or all of the registry, and generally they will have file write capability only within their own Documents and Settings section of the local hard drive. When one of my applications is installed, it's generally done through rights elevation, either through an SMS push or by an administrator logging onto the machine to perform the install.

Some Background
There are four principal locations of the user's Documents and Settings folder structure that are of particular interest when developing applications for limited end-user rights scenarios (the name is dependent on the operating system involved):

  1. My Documents (or Documents): Somewhat obvious, the area where your app will save files that the user can access after the application finishes running (Excel Exports, Save As PDF, etc.).
  2. Application Data (or AppData): A system folder - normally hidden from the user - in which you can store small application-specific files (e.g., your application INI file). There should be a subfolder specific to your application that you store your files in. You should also be aware that there may be a limit imposed on the entire size of the Application Data section by the operating system. This is because Application Data is one of the folders that is involved in roaming profiles, so the size is often restricted to prevent the need to move large amounts of data in those profiles.
  3. Local Settings\Application Data (or AppData\Local): Another system folder, also normally hidden from the user and one in which you should have an application-specific subfolder to store your applications' files. Because this folder is not involved in roaming profiles, there is usually not a restriction on its size, and your application can store much larger files. We allow users to download the application's help file to their local machine so we can do live updates. As a result, we download it into their Local Settings/Application Data folder and then open it from there. In addition, we store a number of other application-specific files there, such as image files we can't embed into the application and our EBF PBD, so that we can add minor mods to the application without requiring a re-install of the application. The one downside is that since this folder is not part of roaming profiles, all of the files downloaded to this area are specific to that user on that machine. If you do use roaming profiles, your users would have to re-download the files on each machine they use.
  4. Local Settings\Temp ( or AppData\Temp): You cannot assume that the location pointed to by the TEMP and TMP environmental variables always point to a location that the user has write privileges to (although in most cases they will point to this folder). To be safe, you should refer directly to this folder, preferably to a subfolder (although you don't need to give it an application-specific name, since it will be purged at some point). This is the work area you would use to store temporary files only used as intermediates during application processing.

All this time I've been discussing the folders that appear under the individual users Documents and Settings folders. For example:

C:\Documents and Settings\<username>\My Documents
C:\Documents and Settings\<username>\Application Data
C:\Documents and Settings\<username>\Local Settings\Application Data
C:\Documents and Settings\<username>\Local Settings\Temp

However, there are also a couple of similar folders under the "All Users" user:

C:\Documents and Settings\All Users\Shared Documents
C:\Documents and Settings\All Users\Application Data

You would use those locations where you wanted to allow all of the users to access a single copy of a particular file, rather than each user having his or her own copy.

When you are writing your own applications and want to ensure that they will work properly in a limited end-user rights environment, the SHGetFolderPath Windows API function will quickly become your friend. Simply send in an enumerated value (called a CSIDL) and it will return the location for that particular folder. It actually handles many more special folders than we care about here; the CSIDL values that we are primarily interested in are shown in Table 1.

The exception, as noted in Table 1, is the Local Settings/Temp folder. There isn't a specific CSLID for it, although there is one for somewhat related folders (e.g., CSIDL_INTERNET_CACHE, which points to Local Settings/Temporary Internet Files). There is a GetTempPath function in the Windows API, but what that returns is the settings for the TEMP or TMP environmental variable. We've seen situations in which someone with admin rights on a workstation has set that variable to point to a location (e.g., C:\TEMP, C:\WINDOWS\TEMP) that a rights-restricted user would not be able to access logging into the same machine. As a result, it may be safer to query for a value such as CSIDL_INTERNET_CACHE and then adjust the value to get to the Temp folder.

Also of note, the MSDN documentation indicates that the SHGetFolderPath function has been deprecated. While that is the case, the new version of the function only works on a rather limited subset of Windows operating systems. For compatibility with older operating systems, you may want to consider sticking with the SHGetFolderPath until such time as Microsoft actually removes it from some future version of the operating system.

How that Affects PowerBuilder
Everything we've talked about so far has to do with applications that you write for users with limited rights. However, in some shops even software developers who use the PowerBuilder IDE are required to run with limited end-user rights. Therefore, it was important to ensure that the PowerBuilder IDE also ran properly in such environments. What this means principally is that stuff you would be able to write to that you used to find in the Program Files/Sybase folder structure has been moved to other locations. Those files generally fall into two categories: those that all users share, and those that are specific to individual users, as shown in Table 2.

While the most effect this will have on a majority of developers is to cause confusion (because they won't find files where they are most used to seeing them), it also serves as an example as to how you might modify your own applications for limited user rights. Particularly as new operating systems arrive (Vista, Windows 7) and limited user rights become more prevalent, it's something you'll probably have to deal with eventually.

Published May. 28, 2009— Reads 2,537
Copyright © 2009 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
Related Stories
▪ New Features in PowerBuilder 11.5 – Part 2
▪ New Features in PowerBuilder 11.5
About Bruce Armstrong
Bruce Armstrong is a development lead with Integrated Data Services (www.get-integrated.com). A charter member of TeamSybase, he has been using PowerBuilder since version 1.0.B. He was a contributing author to SYS-CON's PowerBuilder 4.0 Secrets of the Masters and the editor of SAMs' PowerBuilder 9: Advanced Client/Server Development.

Add Your Feedback

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers

ADS BY GOOGLE

Breaking Java News
FanSnap(R) Launches SeatAlerts to Notify Fans of Their 'Perfect' Tickets
Petromin Resources announces granting of stock options to certain members of its International Advisory Board
Platinex and Ontario Continue Discussions Over Big Trout Lake Property
Garson Gold Announces Filing of Audited Financial Statements for the Year Ended July 31, 2009
Khan Acknowledges ARMZ Intention to Make an Unsolicited Offer
Killdeer Minerals Announces Financing With MineralFields Group
West Street Announces Third Quarter Results
Homeland Uranium Inc. Reprices Options
South American Silver Corp. Completes $2.78 Million Financing

ADVERTISE   |   MAGAZINE SUBSCRIPTIONS   |   FREE BREAKING-NEWSLETTERS!   |   SYS-CON.TV   |   BLOG-N-PLAY!   |   WEBCAST   |   EDUCATION   |   RESEARCH

.NET Developer's Journal - .NETDJ   |   ColdFusion Developer's Journal - CFDJ   |   Eclipse Developer's Journal - EDJ   |   Enterprise Open Source Magazine - EOS
Open Web Developer's Journal - OPENWEB   |   iPhone Developer's Journal - iPHONE   |   Virtualization - Virtualization   |   Java Developer's Journal - JDJ   |   Linux.SYS-CON.com
PowerBuilder Developer's Journal - PBDJ   |   SEO / SEM Journal - SJ   |   SOAWorld Magazine - SOAWM   |   IT Solutions Guide - ITSG   |   Symbian Developer's Journal - SDJ
WebLogic Developer's Journal - WLDJ   |   WebSphere Journal - WJ   |   Wireless Business & Technology - WBT   |   XML-Journal - XMLJ   |   Internet Video - iTV
Flex Developer's Journal - Flex   |   AJAXWorld Magazine - AWM   |   Silverlight Developer's Journal - SLDJ   |   PHP.SYS-CON.com   |   Web 2.0 Journal - WEB2
Apache   |   CMS   |   CRM   |   HP   |   Oracle Journal   |   Perl   |   Python   |   Red Hat   |   Ruby on Rails   |   SAP   |   SaaS

SYS-CON MEDIA:   ABOUT US   |   CONTACT US   |   COMPANY NEWS   |   CAREERS   |   SITE MAP
SYS-CON EVENTS:   |  AJAXWorld Conference & Expo  |  iPhone Developer Summit  |  Cloud Computing Conference & Expo  |  SOA World Conference & Expo  |  Virtualization Conference & Expo
INTERNATIONAL SITES:   India  |  U.K.  |  Canada  |  Germany  |  France  |  Australia  |  Italy  |  Spain  |  Netherlands  |  Brazil  |  Belgium
 Terms of Use & Our Privacy Statement     About Newsfeeds / Video Feeds
Copyright ©1994-2008 SYS-CON Publications, Inc. All Rights Reserved. All marks are trademarks of SYS-CON Media.
Reproduction in whole or in part in any form or medium without express written permission of SYS-CON Publications, Inc. is prohibited.
 
close this window