Menu

#3 VBScript Error During Installation, x64 InkScape, Win10 Pro v1607 x64

v1.0 (example)
open
nobody
None
5
2017-07-16
2017-04-11
silicon83
No

During installation,

Windows Script Host
Script: C:\Program Files (x86)\Inkscape\share\extensions\install_shortcuts.vbs
Line: 4
Char: 1
Error: Subscript out of range
Code: 800A0009
Source: Microsoft VBScript runtime error

Here is the file:

Const ForReading = 1
Const ForWriting = 2

inkscape_folder = WScript.Arguments.item(0)

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(inkscape_folder + "\share\extensions\keys.xml", ForReading)

keys_to_add = objFile.ReadAll
objFile.Close

Set objFile = objFSO.OpenTextFile(inkscape_folder + "\share\keys\default.xml", ForReading)

existing_keys = objFile.ReadAll
objFile.Close

existing_keys = Replace(existing_keys, "</keys>", keys_to_add + "</keys>")

Set objFile = objFSO.OpenTextFile(inkscape_folder + "\share\keys\default.xml", ForWriting)
objFile.WriteLine existing_keys
objFile.Close

set script_file = objFSO.getfile(inkscape_folder + "\share\extensions\install_shortcuts.vbs")
script_file.Delete

Discussion

  • silicon83

    silicon83 - 2017-04-11

    I believe I worked it out? I edited the script for hard-coded paths. It needs to be run as an administrator or an error will occur (I ran a cmd prompt admin then cd'd there and used the script. See:

    Const ForReading = 1
    Const ForWriting = 2

    inkscape_folder = "C:\Program Files\Inkscape"

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile("C:\Program Files (x86)\Inkscape\share\extensions\keys.xml", ForReading)

    keys_to_add = objFile.ReadAll
    objFile.Close

    Set objFile = objFSO.OpenTextFile("C:\Program Files\Inkscape\share\keys\default.xml", ForReading)

    existing_keys = objFile.ReadAll
    objFile.Close

    existing_keys = Replace(existing_keys, "</keys>", keys_to_add + "</keys>")

    Set objFile = objFSO.OpenTextFile("C:\Program Files\Inkscape\share\keys\default.xml", ForWriting)
    objFile.WriteLine existing_keys
    objFile.Close

    set script_file = objFSO.getfile("C:\Program Files (x86)\Inkscape\share\extensions\install_shortcuts.vbs")
    script_file.Delete

     
  • silicon83

    silicon83 - 2017-04-11

    Disclaimer: I am not a programmer. I know computers well and hacked these files together. It would appear to me the installation software needs to have a check for if Inkscape is installed as x86 or x64. It defaulted to 32-bit and on my system that was the cause of the error. If you have already installed or tried the above fix, use the code below as an Administrator to uninstall, then install again and manually alter the path from PFx86 to the 64-bit PF (remove " (x86)" from the install path).

    For another two cents of mine, reading the initial page the author details how to use and not use the software (something about adding layers differently). I would recommend the installer finish with a readme.txt explaining the requirements if not placing it directly in the first or second step of the installer (e. g. WARNING: Using this software requires you to do X differently in InkScape). Hopefully my suggestions are appreciated. Thank you for an otherwise good solution to a problem.

    Here is the uninstall:

    Const ForReading = 1
    Const ForWriting = 2

    inkscape_folder = "C:\Program Files\Inkscape"

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile("C:\Program Files (x86)\Inkscape\share\extensions\keys.xml", ForReading)

    keys_to_add = objFile.ReadAll
    objFile.Close

    Set objFile = objFSO.OpenTextFile("C:\Program Files\Inkscape\share\keys\default.xml", ForReading)

    existing_keys = objFile.ReadAll
    objFile.Close

    existing_keys = Replace(existing_keys, keys_to_add, "")

    Set objFile = objFSO.OpenTextFile("C:\Program Files\Inkscape\share\keys\default.xml", ForWriting)
    objFile.WriteLine existing_keys
    objFile.Close

    set keys_file = objFSO.getfile("C:\Program Files (x86)\Inkscape\share\extensions\keys.xml")
    keys_file.Delete
    set script_file = objFSO.getfile("C:\Program Files (x86)\Inkscape\share\extensions\uninstall_shortcuts.vbs")
    script_file.Delete

     
  • silicon83

    silicon83 - 2017-07-16
    Post awaiting moderation.

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.