Forum > Windows (32/64)

[SOLVED] Portable Lazarus installation

<< < (3/3)

Happen to see this, and still think it's a great idea.  Particularly if this concept could be implemented on other OSes.


--- Quote from: Mike_HDF on February 10, 2021, 09:10:47 am ---Great solution, JoeJoeTV.

Just want to say there's a problem if you have some packages added from the online repository, the path could point to the Windows' users folder in packagefiles.xml (they're grouped under the tag UserPkgLinks). Lazarus will popup a message saying that the package can't be found.

Here is the code I added to yours to fix it:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var//[...]j: Integer;//[...] //After editing editoroptions.xml, for example, you can add://Check packagesfiles.xml for downloaded packagesif FileExists(lazarusDir+confPath+'packagefiles.xml') then begin  WriteLn('SUCCESS');  WriteLn('Editing Package files xml...');   try    ReadXMLFile(XMLDoc,lazarusDir+confPath+'packagefiles.xml',[xrfAllowSpecialCharsInAttributeValue,xrfAllowSpecialCharsInComments,xrfPreserveWhiteSpace]);    nodeEnvOpt := XMLDoc.DocumentElement.FindNode('UserPkgLinks');     if nodeEnvOpt <> Nil then begin      with nodeEnvOpt.ChildNodes do begin        for j := 0 to (Count - 1) do begin          tmpDOMNode := Item[j].FindNode('Filename');           if tmpDOMNode <> Nil then begin            if tmpDOMNode.Attributes.GetNamedItem('Value') <> Nil then begin              tmpDOMNode.Attributes.GetNamedItem('Value').TextContent := ReplaceRegExpr('.*\\(onlinepackagemanager\\.*)',tmpDOMNode.Attributes.GetNamedItem('Value').TextContent,QuoteRegExprMetaChars(lazarusDir + confPath)+'$1',True);            end;          end;        end;      end;       WriteLn('DONE');       Write('Writing packagefiles.xml back to file...');      WriteXMLFile(XMLDoc,lazarusDir + confPath + 'packagefiles.xml');      WriteLn('DONE');    end;  finally    tmpDOMNode.Free;    nodeEnvOpt.Free;    XMLDoc.Free;  end;end else begin  WriteLn('FAIL');  WriteLn;  Write('Press any key to exit...');  ReadLn;end; 
--- End quote ---

--- Quote from: Blade on November 24, 2021, 12:18:48 am ---Happen to see this, and still think it's a great idea.  Particularly if this concept could be implemented on other OSes.

--- End quote ---

I just saw these two answers, I must have missed the notification for the first one.

I'm glad you enjoy this little application of mine.

I'm going to look into the fix that @Mike_HDF suggested sometime, but I need to setup Lazarus on Windows again, since I mostly use Linux now.

I may also look into making a Linux version.


--- Quote from: JoeJoeTV on August 17, 2019, 06:29:04 pm ---... I just want to get rid of that message.

--- End quote ---
One solution is to find in Lazarus startup code where it checks the version etc. and shows the dialog, then change the code to skip the dialog and always update.
Create a patch of your change and apply it to every new Lazarus version that you use in future.
Works in every OS.


[0] Message Index

[*] Previous page

Go to full version