WinRAR SFX (Self Extract) Question

Discussion in 'General Off-Topic Chat' started by jonthedit, Jul 14, 2014.

  1. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    [​IMG]
    Basically I want to have my self extracting winrar archive install a font file before or after it extracts.
    The font file is IN the archive, so if that matters let me know.
    I just have no idea how to properly execute/open the font file automatically via WinRAR.

    I would prefer if the user sees
    [​IMG]
    But they do not have to see it as long as the font installs successfully.

    Any help?
     
  2. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
  3. DinohScene

    DinohScene Dino May Fire

    Member
    GBAtemp Patron
    DinohScene is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    15,616
    11,993
    Oct 11, 2011
    Antarctica
    В небо
    I'd say an execution script would install it for you without seeing the font if you can implement that in yer self extractor...
    Or you could code up a pop up that says "Install font Y/N"...
    Then again, the only font I ever installed on me OS is an Art Deco 1920's styled one xd

    I'm sorry lad, I'm unfortunately of no help on this :c
     
  4. Tom Bombadildo

    Tom Bombadildo Honk!

    pip Contributor
    GBAtemp Patron
    Tom Bombadildo is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    10,385
    10,211
    Jul 11, 2009
    United States
    I forgot
    Back in highschool I used to have to manually install a font every time I logged in (because for some reason every change to Windows made on the local drive was removed every time you logged out). Eventually, I just made a batch file that copied the font into C:\Windows\Fonts and then set it up in the registry as well.

    Code:
    copy "FontName.ttf" "%WINDIR%\Fonts"
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "FontName (TrueType)" /t REG_SZ /d FontName.ttf /f
    Just replace FontName with whatever Font you're trying to add, set it up to run after Winrar finishes extraction, and it should install the font.
     
    jonthedit likes this.
  5. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    This seemed promising, but no luck here.
    Code:
    copy "OCR A Std.ttf" "%WINDIR%\Fonts"
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "OCR A Std (TrueType)" /t REG_SZ /d OCR A Std.ttf /f
    It runs after the Winrar install, however I get an error saying
    "Windows cannot find 'copy' "
    [​IMG]


    I thought about it, and wouldn't the easier solution to be take this code, put it in a .bat and then execute the batch file when the install completes?
     
  6. Tom Bombadildo

    Tom Bombadildo Honk!

    pip Contributor
    GBAtemp Patron
    Tom Bombadildo is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    10,385
    10,211
    Jul 11, 2009
    United States
    I forgot
    Well that's strange :unsure:

    To confirm, you put the text into a batch file (example name being Font.bat) and then in the Winrar SFX options you have it set to run Font.bat?
     
  7. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    Before I do that I want to get the batch file working standalone.
    I added "pause" at the very end to see whats going on.
    When the .bat runs the copy of the font works, however the reg entry fails. See attached.
    [​IMG]


    Edit: Apparently the path of the reg add does not need quotes.
    Still no luck