PDA

View Full Version : How Do I Create Script for All Users vs Single User



crmfghtr
02-03-2011, 06:17 AM
Hello,I created a Custom Dialog With 2 Radio Buttons. One for All Users and the other for a single User. What Script language do I need to make a single User Install or All User Install based on the options. Does anyone have a code example?. Also If the Install is for all Users how do you program the logic to allow all users access to shortcuts? Where does this code go after the file Install procedure or before?
:confused: Robert

linder
02-03-2011, 08:50 AM
Robert,

This is a thing from the past and can't be done in modern UAC-aware operating systems (Windows Vista, Windows Server 2008, Windows 7 and Windows 2008 R2) any longer! The application requests an execution level before the application is started. Installations should be machine-wide today.

The following is a very brief description of how to make an application "UAC-aware"

-- Standard Application:

1. Embed an UAC manifest into your main application (.EXE). A manifest basically tells Windows how aware the program is about the recent Windows versions (and disables "Virtualization"). You should include a manifest for Windows 7 (it's fully backward compatible with all previous Windows versions).

SetupBuilder 7 Developer Edition can embed such a manifest into your executable.

2. Request "asInvoker" execution level privileges through the manifest for your application.

3. Code-sign all your application files (e.g. .EXE, .DLL). SetupBuilder 7 Developer Edition can handle this for you.

4. Your application should not depend on any administrative APIs.

5. Do not write per-user information or user-writable information to Program Files or Program directories.

6. Do not write to any other protected Windows area (e.g. the OS drive root folder, the "Windows" folder tree, etc.).

7. Do not write to the HKEY_LOCAL_MACHINE or any other protected registry key.


-- Standard Installation:

1. Use an UAC-aware installation system. By default, installations run elevated.

2. Install applications per-machine (all users) and store per-user data in different locations.

3. Do not install Quick Launch shortcuts.

4. Never write to per-user locations from the elevated running installer. That means, never write to the HKEY_CURRENT_USER registry key or to per-user file locations.

5. Launch applications non-elevated at the end of the installation process.

6. Code-sign the installer.

Note: if you have to install "per-user" data, install it to a common location and as a "first run" action of your main application, copy the data from the common location into a per-user location.

Respect the recommended (default) locations for applications and data files, but provide users with an option to select another installation location for both. A true "Mixed User Application" should work elevated and non-elevated.

Does this help?

Friedrich