Results 1 to 5 of 5

Thread: Setting wordt niet verwijderd in Inno.

  1. #1

    Setting wordt niet verwijderd in Inno.

    Root: HKCU; Subkey: "{code:GetRegistryfor|D103}\Library\Win64"; Components: "crar"; ValueName: "Search Path"; ValueType: String; ValueData: "{olddata};$(MYSOFT)\RAR\D103\Win64"; Tasks: "d2022"; Check: NeedsAddPath('D10364', '$(MYSOFT)\RAR\D103\Win64') ; MinVersion: 0.0,5.0;

    Root: HKCU; Subkey: "{code:GetRegistryfor|D103}\Library\Win64"; Components: "crar"; ValueName: "Search Path"; ValueType: String; ValueData: "{olddata};{app}\D103\Win64"; Tasks: "d2022"; Check: NeedsAddPath('D10364', '\D103\Win64') ; MinVersion: 0.0,5.0;

    De laatste regel word netjes verwijderd, maar de 1e niet.
    Enig idee hoe dat kan?
    Ik kan nl. geen verschil ontdekken met de regel behalve dat ik een globaal Var, gebruik in Delphi. $(MYSOFT)

  2. #2
    mov rax,marcov; push rax marcov's Avatar
    Join Date
    Apr 2004
    Location
    Ehv, Nl
    Posts
    10,140
    Moet needsAdaPath niet ook een {app} prefix hebben, dus '{app}\D103\win64' ?

  3. #3
    De {app} is hetzelfde als $(mysoft) die is als Var in Delphi heb gezet.

    beide zijn c:\users\all users\local\myprograms\

    ik krijg dan

    C:\Users\All Users\AppData\Local\Delphi Components\RAR\$(MYSOFT)\RAR\D103\Win64

    C:\Users\All Users\AppData\Local\Delphi Components\RAR\D103\Win64

    terwijl de Env. Variable is in Delphi

    MYSOFT C:\Users\All Users\AppData\Local\Delphi Components

  4. #4
    mov rax,marcov; push rax marcov's Avatar
    Join Date
    Apr 2004
    Location
    Ehv, Nl
    Posts
    10,140
    Maar deze expressie: NeedsAddPath('D10364', '\D103\Win64') ;

    heeft geen van beide.

  5. #5
    Sorry, hier is de hele code.

    Code:
    #define MyAppName "RAR Component"
    
    
    [Setup]
    AppName=RAR Component  TEST PACKAGE
    AppVerName=RAR Component 1.0
    DefaultDirName={localappdata}\Delphi Components\RAR 
    DefaultGroupName=RAR Component
    OutputBaseFilename=RAR Component 1.0
    Compression=lzma2
    
    
    [Dirs] 
    
    Name: "{app}";  Permissions: users-modify;
    Tasks: "d2022"; Name: "{commondocs}\Embarcadero\Studio\20.0\Bpl";   
    Tasks: "d2022"; Name: "{commondocs}\Embarcadero\Studio\20.0\Dcp"; 
    
    [Tasks]
    Name: "d2022";  Description: "Delphi XE10.3 Rio";    Check: "DELPHI('D103')";
    
    
     
    [Types]
    ;Name: "full";   Description: "Full installation"  ;
    ;Name: "custom"; Description: "Custom installation";Flags: iscustom  
    
    [-code-]  // veranderd anders werkt the Tag niet goed :)
    
    function GetRegistryfor(CEdition:String) : string;
    var Edition : String;        
    begin  
    if cEdition='D103' then Edition:='Software\Embarcadero\BDS\20.0';
    Result :=  Edition;          
    end;
    
    function RemoveSlashUDF(cPath:String):String;
    begin
    If Copy(cPath,Length(cPath),1) = '\' then cPath := Copy(cPath,1,Length(cPath)-1);                      
    Result := cPath;
    end;
    
    function GetRoot(cEdition:String):String;
    var RValue, retVal: String;           
    begin     
    if RegQueryStringValue(HKEY_CURRENT_USER, GetRegistryfor(cEdition) , 'RootDir', RValue) then
       begin
       RValue := RemoveSlashUDF(RValue);
       retVal :=  RValue ;               
       end;   
    Result := retVal;
    end;
    
    function Compile32(cEdition:String):String;
    var RValue, retVal: String;           
    begin     
      if RegQueryStringValue(HKEY_CURRENT_USER, GetRegistryfor(cEdition) , 'RootDir', RValue) then
         begin
            retVal :=  RemoveSlashUDF(RValue) + '\bin\dcc32.exe'; 
            if cEdition='D103' then createdir(ExpandConstant('{app}') + '\D103\');
    
         end;
      Result := retVal;
    end;
    
    function Compile64(cEdition:String):String;
    var RValue, retVal: String;           
    begin     
      if RegQueryStringValue(HKEY_CURRENT_USER, GetRegistryfor(cEdition) , 'RootDir', RValue) then
         begin
            retVal :=  RemoveSlashUDF(RValue) + '\bin\dcc64.exe'; 
            if cEdition='D103' then createdir(ExpandConstant('{app}') + '\D103\Win64');
    
         end;
      Result := retVal;
    end;
    
    
    
    function DELPHI(cEdition:String):Boolean;
    var RValue: String;    
        retVal: Boolean;           
    begin   
    
     if RegQueryStringValue(HKEY_CURRENT_USER, GetRegistryfor(cEdition) , 'RootDir', RValue) then                               
        begin
        retVal := FileExists(RemoveSlashUDF(RValue) + '\bin\dcc32.exe');        
        end;
    Result :=  retVal;  
    end;
    
    
    function ExpandBPLDCP(cEdition: String; cBPLDCP:String): String;
    begin   
    if cEdition = 'D103' then
       Result :=  ExpandConstant('{commondocs}') + '\Embarcadero\Studio\20.0\' + cBPLDCP;    
    end;
    
    function ExpandBDSCOMMONDIR_DCP(cEdition: String): String;
    begin   
    Result := ExpandBPLDCP(cEdition,'Dcp');
    end;
    
    
    function UpdateLibPath(cVersion: String; cRegKey : String) : String;
    var Searchstring : String;   
        PATH : String;             
    begin
    if cVersion='D103' then Searchstring:=';' + ExpandConstant('{app}') + '\D103';
    
    //Searchstring:=';' + ExpandConstant('{app}') + '\source';
    if RegQueryStringValue(HKCU, cRegKey, 'Search Path', PATH) then
       begin
       StringChangeEx(PATH, Searchstring, '', True);
       StringChangeEx(PATH, ';;', ';', True); 
       RegWriteStringValue(HKCU, cRegKey, 'Search Path', PATH);
       end;
    end;
        
    function NeedsAddPath(cEdition: string; Param: string): boolean;
    var
      OrigPath: string;
      Edition : string;
    begin
    if cEdition='D103'   then Edition:='Software\Embarcadero\BDS\20.0\Library\Win32';
    if cEdition='D10364' then Edition:='Software\Embarcadero\BDS\20.0\Library\Win64';
    
    
    Param:= ExpandConstant('{app}')+Param;
      if not RegQueryStringValue(HKCU, Edition,'Search Path', OrigPath)
      then begin
        Result := True;
        exit;
      end;
      Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
    end;
      
    
    function NeedSearchPath(cEdition: string): string;
    var
      OrigPath: string;
      Edition : string;
    begin
    if cEdition='D103'   then Edition:='Software\Embarcadero\BDS\20.0\Library\Win32';
    if cEdition='D10364' then Edition:='Software\Embarcadero\BDS\20.0\Library\Win64';
    
    
    RegQueryStringValue(HKCU, Edition,'Search Path', OrigPath);
    Result :=OrigPath;
    end;
    
    procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
    begin
      case CurUninstallStep of 
        usPostUninstall:
          begin      
          UpdateLibPath('D103' ,'Software\Embarcadero\BDS\20.0\Library\Win32');
          UpdateLibPath('D103' ,'Software\Embarcadero\BDS\20.0\Library\Win64');    
          end; 
      end; 
    end;
    
    
    function ExpandBDSCOMMONDIR_BPL(cEdition: String): String;
    begin
    WizardForm.ProgressGauge.Position := WizardForm.ProgressGauge.Position  + 1;
    Result := ExpandBPLDCP(cEdition,'Bpl');
    end;
    
    
    function ResetProgressBar(nCount:Integer):Boolean;
    begin
    WizardForm.ProgressGauge.Position := 0;
    WizardForm.ProgressGauge.Max := nCount;   
    Result := True;
    end;
    
    function PackageInfo(cMsg:String):Boolean;
    Begin   
    WizardForm.FileNameLabel.Caption :=  'Compiling and installing: '+cMsg + ' ...';
    Result := True;
    End;
    
          
    
    [Components]
    Name: "crar"; Description: "RAR Component"; Types: full 
    
    [Files]
    Components: "crar"; Source:  "RAR\*";  DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: recursesubdirs 
    
    
    [Registry]                 
    ; Adding the bpl file to the component package
    
    
    Root: HKCU; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"
    
    
    Root: HKCU; Subkey: "{code:GetRegistryfor|D103}\Known Packages"; Components: "crar"; ValueName: "{code:ExpandBDSCOMMONDIR_BPL|D103}\RARComponentDesign260.bpl"; ValueType: String; ValueData: "RAR Component support"; Tasks: "d2022";  MinVersion: 0.0,5.0; Flags: uninsdeletevalue
    
    
    ; Add the folder to the search path                        
    Root: HKCU; Subkey: "{code:GetRegistryfor|D103}\Library\Win32"; Components: "crar"; ValueName: "Search Path"; ValueType: String; ValueData: "{olddata};$(MYSOFT)\RAR\D103";       Tasks: "d2022"; Check: NeedsAddPath('D103',   '$(MYSOFT)\RAR\D103')       ;  MinVersion: 0.0,5.0; 
    Root: HKCU; Subkey: "{code:GetRegistryfor|D103}\Library\Win64"; Components: "crar"; ValueName: "Search Path"; ValueType: String; ValueData: "{olddata};$(MYSOFT)\RAR\D103\Win64"; Tasks: "d2022"; Check: NeedsAddPath('D10364', '$(MYSOFT)\RAR\D103\Win64') ;  MinVersion: 0.0,5.0; 
    Root: HKCU; Subkey: "{code:GetRegistryfor|D103}\Library\Win32"; Components: "crar"; ValueName: "Search Path"; ValueType: String; ValueData: "{olddata};{app}\D103";               Tasks: "d2022"; Check: NeedsAddPath('D103',   '\D103')                    ;  MinVersion: 0.0,5.0; 
    Root: HKCU; Subkey: "{code:GetRegistryfor|D103}\Library\Win64"; Components: "crar"; ValueName: "Search Path"; ValueType: String; ValueData: "{olddata};{app}\D103\Win64";         Tasks: "d2022"; Check: NeedsAddPath('D10364', '\D103\Win64')              ;  MinVersion: 0.0,5.0; 
    
    Root: HKCU; Subkey: "Software\Embarcadero\BDS\20.0\Globals"; ValueName: "ForceEnvOptionsUpdate"; ValueType: String; ValueData: "1";  Tasks: "D2022"
    
    Root: HKCU; Subkey: "Software\Embarcadero\BDS\20.0\Environment Variables"; ValueName: "MYSOFT"; ValueType: String; ValueData: "{localappdata}\Delphi Components";  Tasks: "D2022"
    
    
    [Run]
    Filename: "compiler";   Check: "ResetProgressBar(2)";  Tasks: "d2022";    StatusMsg: "Compiling Delphi XE10.3 Rio package";     Flags: runhidden skipifdoesntexist
    
    
    Filename: "{code:Compile32|D103}"; Check: "PackageInfo('RAR\Packages\RAD Studio XE10.3\RARComponent.dpk')";        Parameters: "-B ""{app}\Packages\RAD Studio XE10.3\RARComponent.dpk""       -Q -I""{code:Needsearchpath|D103}""       -LE""{code:ExpandBDSCOMMONDIR_BPL|D103}""       -LN""{code:ExpandBDSCOMMONDIR_DCP|D103}""       -NU""{app}\D103""       -NS""System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;Data.Win;Web.Win;Soap.Win;Bde;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;"""; WorkingDir: "{app}\Source" ; Tasks: "d2022";  MinVersion: 0.0,5.0; Flags: runhidden;    
    Filename: "{code:Compile32|D103}"; Check: "PackageInfo('RAR\Packages\RAD Studio XE10.3\RARComponentDesign.dpk')";  Parameters: "-B ""{app}\Packages\RAD Studio XE10.3\RARComponentDesign.dpk"" -Q -I""{code:Needsearchpath|D103}""       -LE""{code:ExpandBDSCOMMONDIR_BPL|D103}""       -LN""{code:ExpandBDSCOMMONDIR_DCP|D103}""       -NU""{app}\D103""       -NS""System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;Data.Win;Web.Win;Soap.Win;Bde;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;"""; WorkingDir: "{app}\Source" ; Tasks: "d2022";  MinVersion: 0.0,5.0; Flags: runhidden;    
    Filename: "{code:Compile64|D103}"; Check: "PackageInfo('RAR\Packages\RAD Studio XE10.3\RARComponent.dpk')";        Parameters: "-B ""{app}\Packages\RAD Studio XE10.3\RARComponent.dpk""       -Q -I""{code:Needsearchpath|D103}\Win64"" -LE""{code:ExpandBDSCOMMONDIR_BPL|D103}\Win64"" -LN""{code:ExpandBDSCOMMONDIR_DCP|D103}\Win64"" -NU""{app}\D103\Win64"" -NS""System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;Data.Win;Web.Win;Soap.Win;Bde;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;"""; WorkingDir: "{app}\Source" ; Tasks: "d2022";  MinVersion: 0.0,5.0; Flags: runhidden;    
    
    
    
    
    [Icons]
    
    
     [UninstallDelete]
    Type: filesandordirs; Name: "{app}\D103"
    
    
    
    Type: files;          Name: "{app}\*.*"
    Type: dirifempty;     Name: "{app}"
    ;Deleting BPL and DCP
    
    Type: files;  Name: "{commondocs}\Embarcadero\Studio\20.0\Bpl\rarcompo*.bpl"
    Type: files;  Name: "{commondocs}\Embarcadero\Studio\20.0\Dcp\rarcompo*.dcp"
    Type: files;  Name: "{commondocs}\Embarcadero\Studio\20.0\Bpl\Win64\rarcompo*.bpl"
    Type: files;  Name: "{commondocs}\Embarcadero\Studio\20.0\Dcp\Win64\rarcompo*.dcp"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •