Can anyone help me to combine the following two custom.nsh files. Separately Both codes work fine for me for registering dll, ocx, and font support . As I don't understand how to code custom.nsh , I can not combine both codes to support font and dll or ocx file together. Can anyone combine it in One custom.nsh file for me please.
Font Support
${SegmentFile} !include WinMessages.nsh ${SegmentPrePrimary} ;Load app ttf Fonts FindFirst $0 $1 "$EXEDIR\App\Fonts\*.ttf" ${DoWhile} $1 != "" System::Call "gdi32::AddFontResource(t'$EXEDIR\App\Fonts\$1')i .r2" FindNext $0 $1 ${Loop} FindClose $0 ;Let all running apps know SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=1 !macroend ${SegmentPostPrimary} ;Remove app ttf Fonts FindFirst $0 $1 "$EXEDIR\App\Fonts\*.ttf" ${DoWhile} $1 != "" System::Call "gdi32::RemoveFontResource(t'$EXEDIR\App\Fonts\$1')i .r2" FindNext $0 $1 ${Loop} FindClose $0 ;Let all running apps know SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=1 !macroend
DLL or OCX file Registering
${SegmentFile} ${SegmentPrePrimary} ExecWait 'RegSvr32 /S "$AppDirectory\Subtitler\COMCTL32.OCX"' ExecWait 'RegSvr32 /S "$AppDirectory\Subtitler\divx.dll"' !macroend ${SegmentPostPrimary} ExecWait 'RegSvr32 /U /S "$AppDirectory\Subtitler\COMCTL32.OCX"' ExecWait 'RegSvr32 /U /S "$AppDirectory\Subtitler\divx.dll"' !macroend
For something like this, you just combine the segment contents:
Sometimes, the impossible can become possible, if you're awesome!
I have already tried that. And PAL Creator successfully compiled it. But for some reason neither fonts not dll or ocx registering when using both codes together like you wrote above. I had used separate codes in many apps like a app called DivxMedia Subtitler which requires ocx registering, all worked well. But combining code isn't working.