Skip to content

Instantly share code, notes, and snippets.

@UnaNancyOwen
Last active May 13, 2020 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UnaNancyOwen/8c90d40825378c8bc1585d5d5070d36f to your computer and use it in GitHub Desktop.
Save UnaNancyOwen/8c90d40825378c8bc1585d5d5070d36f to your computer and use it in GitHub Desktop.
FIx NSI for PCL All-in-one Installer (New Version)
Option Explicit
Dim objFileSystem
Dim args
Dim objFile
Dim strPath
Dim strName
Dim strOpenFile
Dim strWriteFile
Dim objOpenTextStream
Dim objWriteTextStream
Dim strSourceText
Dim strResultText
Dim strSplits
'Create Object
Set objFileSystem = CreateObject("Scripting.FileSystemObject")
'Create Open File Path
Set args = WScript.Arguments
strOpenFile = objFileSystem.BuildPath( strPath, args(0) )
'Create Write File Path
Set objFile = objFileSystem.GetFile( args(0) )
strPath = objFile.ParentFolder
strName = objFile.Name
strWriteFile = objFileSystem.BuildPath( strPath, "_" & strName )
'Open Text Stream
Set objOpenTextStream = objFileSystem.OpenTextFile( strOpenFile, 1 )
Set objWriteTextStream = objFileSystem.OpenTextFile( strWriteFile, 2, True )
'Add Line
Do Until objOpenTextStream.AtEndOfStream = True
strSourceText = objOpenTextStream.ReadLine
If InStr( strSourceText, " Delete ""$INSTDIR\bin\pcl_" ) > 0 Then
strSplits = Split( strSourceText, "." )
strResultText = strSplits(0) & "d." & strSplits(1)
objWriteTextStream.WriteLine strSourceText
objWriteTextStream.WriteLine strResultText
ElseIf InStr( strSourceText, " Delete ""$INSTDIR\lib\pcl_" ) > 0 Then
strSplits = Split( strSourceText, "." )
strResultText = strSplits(0) & "d." & strSplits(1)
objWriteTextStream.WriteLine strSourceText
objWriteTextStream.WriteLine strResultText
Else
objWriteTextStream.WriteLine strSourceText
End If
Loop
'Close Object
objOpenTextStream.Close
objWriteTextStream.Close
Set objOpenTextStream = Nothing
Set objWriteTextStream = Nothing
Set objFileSystem = Nothing
Set objFile = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment