cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Taka_Taka_Mu_Ta
Level 3

Trouble Deleting Folder in Vista

Hello all,

I'm new here. I haven't had the time to scour the Forum to see if this question has been addressed before, so forgive me if that's the case.

My Goal: I am using InstallShield 2009 Professional to build an MSI to install PowerShell on Vista computers. After the install, we want the MSI to delete this folder:

"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows PowerShell 1.0"


Steps I'm taking: In the Installation Designer, under Additional tools, I'm using the Direct Editor to modify the Directory Table to include a new directory called "PowerShellStart" that points to the folder I want deleted. Here is that syntax:

Directory = PowerShellStart
Directory_Parent = ProgramMenuFolder
DefaultDir = Window~1|Windows PowerShell 1.0
ISDescription =
ISAttributes = 0
ISFolderName =


I am then using the RemoveFile Table to delete that folder with the following syntax:

FileKey = PSFileRemoval
Component_ = Component_
FileName = *.*
DirProperty = PowerShellStart
InstallMode = 1


...to delete the files, and then also...

FileKey = PSFolderRemoval
Component_ = Component_
FileName =
DirProperty = PowerShellStart
InstallMode = 1


...to delete the folder itself.

Problem The MSI is installing PowerShell just fine, however it is not deleting the folder, or it's contents. I am not sure which variable to use for Vista to understand what I'm trying to delete - "StartMenuFolder" or "ProgramMenuFolder." I'm also not sure if the syntax is correct.

Any assistance would be awesomely appreciated!

Thanks,
Zach Parker
Labels (1)
0 Kudos
(7) Replies
Taka_Taka_Mu_Ta
Level 3

Perhaps this forum isn't the correct place to ask this question, or else it is not visited very frequently.

Otherwise, I can't believe no one knows the answer to this question.

Any help out there? Anyone tried to do things in Vista?

:confused:
0 Kudos
RobertDickau
Flexera Alumni

Does the directory not get removed if you use the Shortcuts view to define the shortcut?

Also, creating an MSI log file during uninstallation can provide some data explaining why Windows Installer does and doesn't add or remove installed data.
0 Kudos
Taka_Taka_Mu_Ta
Level 3

I'm not having trouble during uninstallation of PowerShell, I'm having trouble performing an action to delete that folder after INSTALLING PowerShell. I hope we're on the same page. If so, please clarify what you're asking.

Thanks,
Zach
0 Kudos
RobertDickau
Flexera Alumni

If you're modifying or transforming the MSI that installs PowerShell, could you just remove that from the installer instead of deleting it after the fact?

Otherwise, I'm not sure I understand the relationship between your MSI and the PowerShell MSI; but as a sanity check, you'll want to verify that you have a real component name in the Component_ field of the RemoveFile records, since the file removal is tied to the installation of the component you pick there.
0 Kudos
Taka_Taka_Mu_Ta
Level 3

The PowerShell installer is actually an MSU file, and not an MSI. I cannot modify it as it is. What I'm doing is performing the install of the PowerShell MSU and then after the fact, trying to have the MSI that I'm building around the MSU install delete the folder it creates in the Start Menu, so users cannot access the PowerShell shortcut.

That is a good point about the Component name. When I was working with the Acresso trainer on building this package, he had it set to Component_. I wasn't sure why, nor did I know what to change it to.
0 Kudos
Taka_Taka_Mu_Ta
Level 3

*shameless bump*

Any more helpful insight into this problem that still exists for me?
0 Kudos
RobertDickau
Flexera Alumni

Oh, with the "wasn't" and "did", I thought the problem was resolved... The Component_ value is just the default value InstallShield puts in the field of the same name in the RemoveFile table; perhaps select some component in your MSI package that will always be installed, ensuring that RemoveFile record takes effect?
0 Kudos