Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Deleting Old Virtualization Files on New Install in Windows Vista

Updated: 21 May 2010 | 3 comments
MRoach1779's picture
0 0 Votes
Login to vote

I'm currently using the WiseScript Editor in the Wise Installation Studio build 7.3.0.250 to write a fresh installation routine for an application that up until the latest version was not compatible with Windows Vista.  Because of this incompatibility UAC would virtualize several key components of the application when the program was installed on a Vista PC. 

An updated version of the software is released every year around the same time, so users are frequently re-installing the software on machines that have had a previous versions installed on them.
The software only supports Windows XP and Vista at this time.

I'm trying to find a way to get the installer to determine if the user is running Vista, and if so, go into the virtualization folder of the user running the install and delete the old virtualization files before installing the new program components in the "Program Data" folder according to good programming practices for Vista. 

Obviously, because of the way UAC virtualizes the files, these folders are always under the user profile of the person running the application at the time they trigger the behavior in the program that results in virtualization.  

These users are almost always the same users that will later be re-installing the new version of the software so it is only necessary to get the current user information into the USERPROFILE variable, however I seem to be having a hard time getting the USERPROFILE variable and then appending it with the path to the virtualization folder to script the "Delete File(s)" command.

Basically, I need to know how to, in WiseScript, tell the install "If system has Windows Vista, then delete file(s) C:\Users\{Username}\AppData\Local\VirtualStore\Program Files\EFS\efslocal.db" if it exists.

 

Comments

EdT's picture
26
Aug
2009
1 Vote +1
Login to vote

Wisescript options

You can use the "Get System Information" command to return the major and minor versions of the operating system, so finding out whether you are running Vista should be pretty straightforward (Major version = 6.0 )
USERPROFILE also exists as an environment variable, if I'm not mistaken - it certainly does in XP so I would assume it is there also in Vista.

Therefore you can use the Wisescript command "Get Environment Variable" to load the USERPROFILE env variable into a wisescript variable.

You can then use this parameter in the Delete Files/Folders command in an "If File Exists" loop to delete the file(s) in question.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

greendaale's picture
23
Oct
2009
0 Votes 0
Login to vote

Is it possible to find a

Is it possible to find a given VirtualStore directory without using WiseScript? If so, how do I proceed? I use Wise Installation Express v7.3

Regards,

Greendaale

EdT's picture
23
Oct
2009
1 Vote +1
Login to vote

What would you wish to use in place of Wisescript?

What would you wish to use in place of Wisescript? Any scripting language would work, or alternatively, since the virtual store folder path looks something like this:

c:\users\<username>\AppData\VirtualStore\Program Files\<YourApp>

you could use System Search in your MSI to look for the virtual folder you are interested in, and return the path if found.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.