开发者

Use innosetup script to delete previously installed application folder

I am deleting the previous application usin开发者_如何学运维g the script which inturn calls my .net app. All i want is to actually delete the folder(entire app1) from start menu (start->Programs->app1->uninstall app1)?

Thanks Gauls


If you just want to delete the "uninstall app1" icon from the Start menu, the following should work:

[InstallDelete]
Type: files; Name: "{group}\uninstall app1"

If you want to remove the entire program group from the start menu, use the following:

[InstallDelete]
Type: filesandordirs; Name: "{group}"

This assumes that your Inno Setup script Start menu folder name is the same as the previous "app1" application.


None of those worked for me, after work-around, here is my solution; in [Setup]

//Delete old entry folder from start menu
procedure DeleteOldStartMenuEntry;
var
 entry: String;
begin
 //Replace "Diviner" with desired folder name 
 entry := ExpandConstant('{commonprograms}') + '\Diviner\';
 if DirExists(entry) then begin
   DelTree(entry, true, true, true);
  end 
end;

Inside InitializeSetup call your procedure :

function InitializeSetup: Boolean;
var:
    ....
begin
    ....
    DeleteOldStartMenuEntry;
    ....
end;


Thanks Craig my new app doesn't have the same name (app2) following worked for me

[InstallDelete]
Type: filesandordirs; Name: {commonprograms}\app1 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜