Skip to content

Instantly share code, notes, and snippets.

@genius257
Last active July 12, 2018 20:47
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 genius257/3d669eaa01285f221e35e79fc556ad10 to your computer and use it in GitHub Desktop.
Save genius257/3d669eaa01285f221e35e79fc556ad10 to your computer and use it in GitHub Desktop.
#AutoIt3Wrapper_Res_File_Add=C:\Users\me\Desktop\88x31.jpg
#AutoIt3Wrapper_Res_Icon_Add=C:\Users\me\Desktop\logo.ico
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include 'WinAPIFiles.au3'
#include "File.au3"
; Script Start - Add your code below here
Local $bFileInstall = False ; Change to True and ammend the file paths accordingly.
; This will install the file C:\Test.bmp to the script location.
If $bFileInstall Then FileInstall("C:\Test.bmp", @ScriptDir & "\Test.bmp")
$sFile = FileRead(@ScriptFullPath)
$pattern = '(?(DEFINE) (?<string>(["''''])((?!\2).)*\2))(?:#include ((?&string))|FileInstall\(((?&string))|#AutoIt3Wrapper_Res_[a-zA-Z]+_Add=([^\n]+))'
$aResults = StringRegExp($sFile, $pattern, 3)
_ArrayDisplay($aResults)
Dim $aResult[0]
For $i=0 To UBound($aResults)-1
If StringLen($aResults[$i])>0 Then
ReDim $aResult[UBound($aResult)+1]
$aResult[UBound($aResult)-1] = StringRegExpReplace($aResults[$i], '^(["''''])(.*)\1', "$2")
EndIf
Next
_ArrayDisplay($aResult)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment