Windows batch file for patching your mods into Vivaldi



  • As mentioned in the introductory post, we are aware that every update wipes your mods, which is pretty annoying if you need to reapply them each and every time. Until there is a way in Vivaldi that rids this need, I tinkered a little batch script that patches your mods into Vivaldi: [code] ::::::::::::::::::::::::::::::::::::::::::: :: Script to copy over your Vivaldi mods :: :: by Christoph142 :: ::::::::::::::::::::::::::::::::::::::::::: @echo off setlocal enabledelayedexpansion :: This is the folder that contains your modded files (make sure it uses similar folder structure): set "modFolder=C:\Users\You\Vivaldi Mod Files" :: This is a list of your Vivaldi installations' Application folders (you can use the Vivaldi folder, too, but it takes longer to find the file): set installPaths="C:\Users\You\AppData\Local\Vivaldi\Application" "C:\Users\You\Testcenter\Final 32-bit\Application" "C:\Users\You\Testcenter\Snapshot\Application" :: Don't alter anything below this point ;) set nrOfInstalls=0 set nrOfSuccessfulPatches=0 for %%i in (%installPaths%) do (



  • set "modFolder=C:\Users\You\Vivaldi Mod Files"
    seems wrong to me, should be, if anything
    set modFolder="C:\Users\You\Vivaldi Mod Files"
    you can also use %LOCALAPPDATA% instead of C:\Users\You\AppData\Local
    and %USERPROFILE% instead of C:\Users\You



  • It seems odd, but this is the only correct way of assigning paths including whitespaces to a batch script variable. ;)
    Your version assigns a string including the quotation marks to the variable.

    And you know that these folders are example paths, right? They don't get used in production unless you forget to substitute them. :silly:



  • it's strange, it doesn't seem needed to me

    set "modFolder=C:\Users\You\Vivaldi Mod Files"
    echo x%modFolder%x
    set modFolder=C:\Users\You\Vivaldi Mod Files
    echo x%modFolder%x

    this produces the same output, no need of quotes at all



  • Believe me, you do. Echoing (as text) is not the same as using it as a folder. This script got tested by us and is solid.



  • @Christoph142:

    And you know that these folders are example paths, right? They don't get used in production unless you forget to substitute them. :silly:

    of course, these system variables are already set so you don't have to edit the batch everytime you change user or pc =)



  • Mod folder and batch file should be put together to work correctly?
    Custom.css copying worked, but other files are not always correctly copied (the browser.html was backed up, but not copied); it says something like "cyclic error".

    I've script in C:\Portable programs\VivaldiRC\script.bat
    and mod folder in C:\Portable programs\VivaldiRC\Application\Mod
    Paths in the batch points to my mod folder/vivaldi, obviously :P



  • You seem to be doing something wrong.
    You can place the mod where you want. It doesn't need to stay in your modding directory.
    Just make sure to set
    [ul]

    • modFolder to the root of your mods (i.e. "modFolder=C:\Portable programs\VivaldiRC\Application\Mod") and
    • installPaths to your Vivaldi Application directory (i.e. installPaths="C:\Portable programs\VivaldiRC\Application" in your case)
      [/ul]

    and pay attention to not add additional whitespaces and keep the quotation marks where they are. ;)



  • Searching for newest browser.html in C:\Users\Bende\AppData\Local\Vivaldi\Application\...'dir /a:-d /b /s "C:\Users\Bende\AppData\Local\Vivaldi\Application\"' is not recognized as an internal or external command, operable program or batch file.
    
    Couldn't find it. :(
    Is C:\Users\Bende\AppData\Local\Vivaldi\Application\ the correct Vivaldi Application folder?
    
    All done! :)
    Successfully patched 0 out of 1 installs.
    
    Press any key to continue . . .
    

    It's kind of difficult to make out the code as Markdown has mangled it somewhat (whoever devised Markdown as a formatting system needs shooting before they reproduce any more), but as far as I can tell, the Command Prompt is parsing the dir command incorrectly, and it is not performing the search that the command ought to do. The only things in this Batch that I've modified are the two sets at the top.

    To answer the Batch File's query: yes, that is the correct Application folder. it has the Application in it.
    So what's going on?



  • Hi, the new forum doesn't display correctly the first post :-(



  • @Hobbes Yeah, the new forum unfortunately doesn't support the same markup as the old one did. I tried to fix that for you ;)



  • @Christoph142
    Great, thanks !



  • Does anyone have the complete version of this? I don't think the snippets above can possibly be all.


Log in to reply
 

Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.