Tuesday, October 16, 2007

Delete old folder on upgrade

Here's the installscript funciton I wrote to delete the start menu shortcuts using the old company name when a folder structures were updated to reflect the new company name.

This worked with Installshield 11.
The following function was added to a .rul file. A custom action was then created for the funciton. The custom action was then added to the execute sequence.

function DeleteOldCompanyNameShorcuts(hMSI)
begin
//Errors should not be highlighted as this function will be called multiple times
// on subsequent calls there should be nothing left to delete
// Also, there may not be anything to delete in the first place

//default group type is common
//Delete old company name shortcuts from all users menu
DeleteProgramFolder(FOLDER_PROGRAMS ^ "Old Company Name");

//Delete old company name shortcuts from current users menu
ProgDefGroupType(PERSONAL);
DeleteProgramFolder(FOLDER_PROGRAMS ^ "Old Company Name");
end;

0 comments:

Post a Comment

I get a lot of comment spam :( - moderation may take a while.