!include "FileFunc.nsh"
!include "WinMessages.nsh"

Name "hwidgen.mk3.mod"
Caption "hwidgen.mk3.mod"
OutFile "hwidgen.mk3.mod.exe"
SetCompressor /SOLID lzma
SetDateSave off
RequestExecutionLevel admin

LicenseBkColor /windows
AutoCloseWindow true
ShowInstDetails show

Icon src\icon.ico
VIAddVersionKey "ProductName" "HWIDGEN MOD"
VIAddVersionKey "Comments" "Modified version of HWIDGEN"
VIAddVersionKey "CompanyName" "(C) Dumpster Inc. & others"
VIAddVersionKey "LegalCopyright" "(C) Dumpster Inc. & others"
VIAddVersionKey "FileDescription" "HWIDGEN MOD"
VIAddVersionKey "FileVersion" "10.08"
VIProductVersion 10.08.0.0

Function .onInit
  ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6
  StrCpy $INSTDIR "$TEMP\hwidgen_$2$1$0$4$5$6"
FunctionEnd

PageEx license
  Caption " "
  LicenseData src\license.rtf
  LicenseText "Please review the information that can be found below. Click OK when you are ready to run the tool." "OK"
PageExEnd
PageEx instfiles
  Caption ": Preparing files"
PageExEnd

Section ""
  SetOutPath $INSTDIR
  File src\AutoHotkey.exe
  File src\gatherosstate.exe
  File src\gatherosstateLTSB2015.exe
  File src\hwidgen.ahk
  File src\slc.dll

  ${GetExePath} $R0
  ${GetParameters} $R1

  SetOutPath $R0
  ShowWindow $HWNDPARENT ${SW_HIDE}
  ExecWait '"$INSTDIR\AutoHotkey.exe" "$INSTDIR\hwidgen.ahk" $R1'

  RMDir /r $INSTDIR
SectionEnd
