

REM This Is where the rest of the script goes REM Otherwise, it will skip our next SETMOG function and goto NOMOG error block REM MOGEXIST will only be defined if mogrify.exe is found in a sub folder of %PFFolder% (aka %PF% aka %ProgramFiles%). REM Now broken out of mogrify check loop, pop back out of %PFFolder% REM Flowed from mogrify check loop, this means we didn't find her REM SET IMDIR=C:\Program Files\ImageMagick-6.8.7-Q16 REM Finally if one is found, SET MOGEXIST to TRUE, grab it's directory and SET it as IMDIR and GOTO CONT2, the next step, breaking out of the loopĮCHO Searching for mogrify.exe in %PF%. REM then check IF the name is equal to "mogrify.exe" REM Push into the current directory and start the FOR loop REM We're assuming that the user has installed the 32bit version of IM on their 32bit machine, and 64bit IM on their 64bit machine, duh REM NOTE the second SET and the IF statement nested in the FOR loop. IF "%PROCESSOR_ARCHITECTURE%"="AMD64" (GOTO X64) ELSE GOTO X86 REM Search for mogrify in the progfiles W6432 Tree (The 圆4 C:\Program Files\ folder on a 64bit machine) REM We also need to check what architecture the user has, and where abouts IM is installed. REM This will future proof this converter so long as IM don't change the name of "mogrify.exe" REM We need to dynamically find mogrify.exe and use it's location as a variable If you don't want to keep the "resized" versions of the PNGs, add this before the POPD line Ĭode: Select all REM = This script also means you do not need to resize the icons manually, and includes the Apple retina sizes (96x96, 48x48) and the 256x256 "PNG" layer for very large icons in Windows/OSX. This didn't work for me, and I had to reverse the order to be " highest to lowest" and after which the proper large transparent ICO was created (instead of it being 16x16) On this thread, and the IM Examples site gives you " lowest to highest" increasing file dimensions as the order to convert with. I noticed that the biggest problem was the order in which the size files come for the convert to ICO command. SET IMDIR=C:\Program Files\ImageMagick-6.8.7-Q16
