Use innosetup script to delete previously installe

2019-05-02 03:20发布

I am deleting the previous application using 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

标签: inno-setup
3条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-05-02 03:29

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;
查看更多
孤傲高冷的网名
3楼-- · 2019-05-02 03:40

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

[InstallDelete]
Type: filesandordirs; Name: {commonprograms}\app1 
查看更多
爷的心禁止访问
4楼-- · 2019-05-02 03:47

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.

查看更多
登录 后发表回答