[main]
Title=WinMerge
Description=WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.
Selected=False
Level=5
Author=Misty
Version=20230210
Date=2023-02-10
Interface=Interface1

[Interface1]
pTextLabelMenu1="1",1,1,35,3,70,18,10,Bold
pButtonMenu2="2",1,8,75,0,70,20,pButtonMenu2,0,True,_pButtonMenu2_,True
pButtonMenu3="?",1,8,145,0,70,20,pButtonMenu3,0,True,_pButtonMenu3_,True
pWebLabel1=https://winmerge.org/,1,10,51,100,216,18,https://winmerge.org/
pTextLabel1="WinMerge Website",1,1,51,77,230,18,10,Bold
pCheckBoxInWim="Include Program in boot.wim",1,3,51,265,180,18,True

[Interface2]
pButtonMenu1="1",1,8,5,0,70,20,pButtonMenu1,0,True,_pButtonMenu1_,True
pTextLabelMenu2="2",1,1,108,3,70,18,10,Bold
pButtonMenu3="?",1,8,145,0,70,20,pButtonMenu3,0,True,_pButtonMenu3_,True
pBevel1=,1,12,10,65,66,2
pTextLabel="Menu Entries",1,1,10,50,230,18,8,Bold
pCheckBoxShortcutDesktop="Add to Desktop Menu",1,3,40,80,150,18,True
pCheckBoxShortcutQuick="Add to Quicklaunch Menu",1,3,40,110,150,18,True
pCheckBoxShortcutPrograms="Add to #$qStart#$q > ",1,3,40,140,99,18,True
pCheckBoxShortcutLaunchBar="Add to LaunchBar Menu ",1,3,40,170,150,18,True
pButtonShortcut1=?,1,8,10,80,18,18,pButtonShortcut1,0,True,_pButtonShortcut1_,True
pButtonShortcut2=?,1,8,10,110,18,18,pButtonShortcut2,0,True,_pButtonShortcut2_,True
pButtonShortcut3=?,1,8,10,140,18,18,pButtonShortcut3,0,True,_pButtonShortcut3_,True
pButtonShortcut4=?,1,8,10,170,18,18,pButtonShortcut4,0,True,_pButtonShortcut4_,True
pTextBox1=,1,0,140,140,150,21,Programs

[pButtonMenu1]
IniWrite,%ScriptFile%,Main,Interface,Interface1
System,REFRESHINTERFACE

[pButtonMenu2]
IniWrite,%ScriptFile%,Main,Interface,Interface2
System,REFRESHINTERFACE

[pButtonMenu3]
message,"Click on the buttons to toggle between tabs 1 and 2. #$x#$xTab 2 contains menu options for use in the selected shell. Click on the ? button for information about the different options."

[pButtonShortcut1]
message,"WinXShell only#$x#$xSelect this option to add a program shortcut to the Desktop."

[pButtonShortcut2]
message,"WinXShell only#$x#$xSelect this option to add a program menu option to the Quicklaunch menu - similar in appearence to the 'Pin to Taskbar' option in Windows 7/8/10."

[pButtonShortcut3]
message,"Applies to WinXShell#$c BBLean and LaunchBar Shell(s)#$x#$xSelect this option to add a program menu option to the Start menu. Leave blank to add to the root of the menu#$c or manually type a path to place in a sub-menu (do not use spaces in the path). E.g. #$x#$s- FileManager#$x#$s- Programs#$x#$s- Programs\FileManager#$x#$xAnd looking at the examples above - #$x#$xLeave this option blank to add a menu entry to the root of the program menu (the 'Start' menu in WinXShell#$c the 'Start' menu in BBLean#$c or the root of the LaunchBar menu bar if LaunchBar is selected as Shell)#$x#$xEnter 'FileManager' to add a menu entry for this application to the 'Start' > 'FileManager' sub-menu (WinXShell and bblean) or the 'FileManager' sub-menu in LaunchBar.#$x#$xEnter 'Programs' to add a menu entry for this application to the 'Start' > 'Programs' sub-menu (WinXShell and bblean) or the 'Programs' sub-menu in LaunchBar.#$x#$xEnter 'Programs\FileManager' to add a menu entry for this application to the 'Start' > 'Programs' > 'FileManager' sub-menu (WinXShell and bblean) or the 'Programs' > 'FileManager' sub-menu in LaunchBar."

[pButtonShortcut4]
message,"This setting does not apply to any LaunchBar instance running as the WinPE Shell. This option only applies to a LaunchBar instance when the Applications' > 'LaunchBar' program script is selected in the build.#$x#$xIf the 'Applications' > 'LaunchBar' program script is selected than enable this option to add a program menu entry to the root of the LaunchBar menu bar. #$x#$xPlease note that if option '6] Programs in boot.wim' in the main project script is set as 'NO'#$c then LaunchBar and a number of other applications will not be available at boot. In this case a text based .ini file will be used for LaunchBar menu settings."

[process]
If,%Builder%,Equal,PEBakery,If,%FullProjectRun%,Equal,NO,Run,"%ProjectDir%\Core\common.script",PostConfigRunV2
If,%Builder%,Equal,WinBuilder,If,%FullProjectRun%,Equal,NO,Run,"%ProjectDir%\Core\common.script",PostConfigRunV2_winbuilder
AddInterface,%ScriptFile%,Interface1,""
AddInterface,%ScriptFile%,Interface2,""
If,%pCheckBoxInWim%,Equal,True,Set,%PROGRAMS.IN.WIM%,YES
Else,Set,%PROGRAMS.IN.WIM%,NO
Run,%ScriptFile%,CHECKS
Run,%ScriptFile%,MENU
Run,%ScriptFile%,COMMON
If,%PROGRAMS.IN.WIM%,Equal,NO,Run,%ScriptFile%,NOT.IN.WIM
If,%PROGRAMS.IN.WIM%,Equal,YES,Run,%ScriptFile%,IN.WIM

[CHECKS]
If,Not,ExistFile,"%Programs%\WinMerge\%ARCH%\WinMergeU.exe",Begin
  Message,WinMerge is missing - exiting script...,Error,5
  Exit,WinMerge is missing - exiting script...,WARN
End

[MENU]
If,%PROGRAMS.IN.WIM%,Equal,NO,Begin
  If,Not,ExistFile,"%OutputDir%\Programs\ShortcutsNotInWim.txt",Run,"%ProjectDir%\Core\common.script",NotInWim
  TXTaddline,"%OutputDir%\Programs\ShortcutsNotInWim.txt","#$p~dp0nircmd.exe shortcut #$q#$p~dp0WinMerge\WinMergeU.exe#$q #$q#$pTemp#$p\ShortCuts#$q #$qWinMerge#$q",Append
End
If,%PROGRAMS.IN.WIM%,Equal,YES,Begin
  ShellExecute,Hide,"%Tools%\Shortcut.exe","/A:C /T:#$q#$pSystemDrive#$p\Programs\WinMerge\WinMergeU.exe#$q /F:#$q%ProjectTemp%\WinMerge.lnk#$q /I:#$q#$pSystemDrive#$p\Programs\WinMerge\WinMergeU.exe#$c0#$q"
  If,ExistFile,"%ProjectTemp%\WinMerge.lnk",Begin
    Set,%MyShortcut%,WinMerge.lnk
    If,%pCheckBoxShortcutDesktop%,Equal,True,FileCopy,"%ProjectTemp%\%MyShortcut%","%ProjectTemp%\ShortCuts\Desktop"
    If,%pCheckBoxShortcutQuick%,Equal,True,FileCopy,"%ProjectTemp%\%MyShortcut%","%ProjectTemp%\ShortCuts\Quick"
    If,%pCheckBoxShortcutPrograms%,Equal,True,Begin
      Set,%ProgramMenuPath%,%pTextBox1%
      Run,"%ProjectDir%\Core\common.script",StartMenu
    End
    If,%pCheckBoxShortcutLaunchBar%,Equal,True,FileCopy,"%ProjectTemp%\%MyShortcut%","%ProjectTemp%\ShortCuts\LaunchBar"
    If,%FullProjectRun%,Equal,NO,Run,"%ProjectDir%\Core\common.script",PostConfigRunShortcuts
    FileDelete,"%ProjectTemp%\%MyShortcut%"
  End
End

[COMMON]
If,%PROGRAMS.IN.WIM%,Equal,NO,Set,%PATH%,%OutputDir%
If,%PROGRAMS.IN.WIM%,Equal,YES,Set,%PATH%,%TargetDir%
If,Not,ExistDir,"%PATH%\Programs",DirMake,"%PATH%\Programs"
DirMake,"%PATH%\Programs\WinMerge"
ECHO,"Copying files..."
DirCopy,"%Programs%\WinMerge\%ARCH%\*.*","%PATH%\Programs\WinMerge"
ShellExecute,Hide,"%Tools%\wimlib\wimlib-imagex.exe","extract #$q%Install.wim%#$q %Install.wim.Image.number% \Windows\System32\oledlg.dll --dest-dir=#$q%TargetDir%\Windows\System32#$q --no-acls"
IniWrite,"%OutputDir%\Project.Settings.ini",PROGRAMS,WinMerge,YES

[IN.WIM]
If,%FullProjectRun%,Equal,NO,Begin
  IniRead,"%TargetDir%\Project.Settings.ini",Main,Image.Number,%Boot.wim.Image.number%
  ECHO,"Injecting files to boot.wim..."
  If,%Builder%,Equal,PEBakery,WimPathAdd,%OutputDir%\sources\boot.wim,%Boot.wim.Image.number%,%TargetDir%,""
  Else,ShellExecute,Hide,"%TOOLS%\wimlib\wimlib-imagex.exe","update #$q%OutputDir%\sources\boot.wim#$q %Boot.wim.Image.number% --command=#$qadd '%TargetDir%' '\'#$q"
End
//Wait,1

[NOT.IN.WIM]
//Wait,1
If,%FullProjectRun%,Equal,NO,Run,"%ProjectDir%\Core\common.script",PostConfigRunNotInWim

[AuthorEncoded]
WinMergeU_100.ico=47036,62715
Logo=WinMergeU_100.ico

[EncodedFile-AuthorEncoded-WinMergeU_100.ico]
lines=15
[encoded data, 62753 characters]
