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
Drool, Britannia? Is the UK Failing the Cloud?
By Roger Strukhoff
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Jan. 8, 2012 11:38 AM EST
read more & respond »
Cloud Expo on Google News
Did you read today's front page stories & breaking news?

Cloud Expo & Virtualization 2011 West
Keynotes
Oracle
Opening Keynote | An Enterprise Cloud for Business-Critical Applications
Abiquo
Day 2 Keynote | The Enterprise Cloud Tightrope - Balancing for Success
Akamai
Day 3 Keynote | The DNA of an Enterprise Cloud
DIAMOND SPONSOR:
Oracle
Many Clouds, Many Choices'Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Enterprise Cloud Best Practices - Town Hall - Join the discussion…
PLATINUM SPONSORS:
Intel
Progressing Toward the Federated, Automated and Client-Aware Cloud
New Relic
How to build an app with Twitter-like throughput
Rackspace
Computing in the Cloud Era
GOLD SPONSORS:
Gale Technologies
Practical Cloud Migration
IBM
Re-think IT. Re-inventing Business.
Intel/McAfee
Identity Driven Security in the Cloud
PerspecSys
Hackers Hackers Everywhere, Is My Public Cloud That Safe?
Red Hat
Unlock the Value of the Cloud
SHI
Mission Critical Applications and the Cloud - Myth or Reality?
SoftLayer
Not Your Grandpa's Cloud
Terremark
Integrating Enterprise Clouds
VMware
Upgrade to a vCloud
POWER PANELS:
Cloud Expo Silicon Valley: CTO Power Panel
Cloud Expo Silicon Valley: CEO Power Panel
Cloud Expo Silicon Valley: Cloud SuperStars Panel
Cloud Expo Silicon Valley: CloudNOW Panel
Click For 2010 West
Event Webcasts
Cloud Expo & Virtualization 2011 East
DIAMOND SPONSOR:
Dell
Dell & VMware Deliver the Enterprise Hybrid Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Are Financial Services Organizations Risking Security by Avoiding Cloud Computing?
Oracle
From Consolidation to Enterprise Private PaaS
PLATINUM SPONSORS:
Intel
Driving the Transformation to Next Generation Cloud Data Centers
Rackspace
The Inevitability of an Open Cloud
GOLD SPONSORS:
CA Technologies
Follow YOUR path to Cloud Computing
Interxion
Who Keeps the Cloud in the Air?
Microsoft
Patterns for Cloud Computing
PerspecSys
War in the Clouds: Are you ready?
ServiceMesh
The Big Win: Stop Playing Small-Ball with Your Cloud Strategy
Terremark
Evaluating Enterprise Clouds
Xiotech
Cloud Storage: Myths and Realities
POWER PANELS:
Cloud Expo New York: CTO Power Panel
Cloud Expo New York: CEO Power Panel
Cloud Expo New York: CMO Power Panel
Cloud Expo New York: Wrap-Up Power Panel
Click For 2010 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 8,124
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
New Sample & Promotional Item Ordering in Veeva CRM Drives Down IT Costs and Improves Marketing ROI for Life Sciences Companies
Research and Markets: Argentina Information Technology Report Q1 2012
Kellogg Company Announces Agreement to Acquire Procter & Gamble's Pringles Business
Market Research Projects Telemedicine Market Growth at 19% CAGR Through 2015
Renesas Mobile Introduces First Integrated LTE Triple-Mode Platform Optimised for Full-Featured, High Volume Smartphones
Deadline for Massachusetts Private Non-Profit Organizations to Apply for SBA Economic Injury Disaster Loans is March 15
Renesas Mobile Introduces First Integrated LTE Triple-Mode Platform Optimised for Full-Featured, High Volume Smartphones
Kellogg Company Announces Agreement to Acquire Procter & Gamble's Pringles Business
Comcast Increases Dividend and Share Repurchases
Avista Corp. Reports Financial Results for Fiscal Year and Fourth Quarter 2011

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