You are here

Registering a DLL

8 posts / 0 new
Last post
GothicDeath
Offline
Last seen: 12 years 2 months ago
Joined: 2011-01-13 07:39
Registering a DLL

Hi,

I'm needing the PAL to register and unregister a DLL on launch. I have added RegisterDLL to launcher.ini (though it was supported in v2.1) but it still does not work. Is their anyway to get it to reg/unreg dll(s)?

Thanks


[RegisterDLL]
1=%PAL:AppDir%\SmartFTP\sfFavorites.dll

Aluísio A. S. G.
Offline
Last seen: 7 years 9 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Not supported yet

Automatically registering DLLs is not supported yet. You'll need to use custom code to call RegSvr32.

Previously known as kAlug.

GothicDeath
Offline
Last seen: 12 years 2 months ago
Joined: 2011-01-13 07:39
Ok so added in the "source"

Ok so added in the "source" folder. PortableApps.comLauncherCustom.nsh

Code used is, but still does not register on launch. What am I doing wrong?

${SegmentFile}

${SegmentPrePrimary}
RegDLL $AppDirectory\SmartFTP\sfFavorites.dll
!macroend

${SegmentPostPrimary}
UnRegDLL $AppDirectory\SmartFTP\sfFavorites.dll
!macroend

stwum
Offline
Last seen: 3 years 1 month ago
Joined: 2007-06-24 06:53
GothicDeath, Try this,

GothicDeath,

Try this,

${SegmentFile}

${SegmentPrePrimary}
	ExecWait '$SYSDIR\regsvr32.exe /s "$AppDirectory\SmartFTP\sfFavorites.dll"'
!macroend

${SegmentPostPrimary}
	ExecWait '$SYSDIR\regsvr32.exe /s /u "$AppDirectory\SmartFTP\sfFavorites.dll"'
!macroend

It works for me in other apps.

GothicDeath
Offline
Last seen: 12 years 2 months ago
Joined: 2011-01-13 07:39
Lauching a bat file on load and on exit?

Ok, since I still can't get the custom parameters to work right. I was wondering. How do I make the Launcher, launch a start bat file & then a close bat file.

The bat files are going to do all the registration/un-reg of the dlls needed to work.

Aluísio A. S. G.
Offline
Last seen: 7 years 9 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Before doing that

Try this custom code for the registering:

${SegmentFile}

${SegmentPrePrimary}
    ExecWait 'RegSvr32 /S "$AppDirectory\SmartFTP\sfFavorites.dll"'
!macroend

${SegmentPostPrimary}
    ExecWait 'RegSvr32 /U /S "$AppDirectory\SmartFTP\sfFavorites.dll"'
!macroend

Previously known as kAlug.

GothicDeath
Offline
Last seen: 12 years 2 months ago
Joined: 2011-01-13 07:39
It hate me lol

Thanks for trying to help with this kAlug. Well, I gave your code a shot and it still does not reg on launch. Also, tried changing the PrePrimary to PreExec to see if it's a problem registering after the exe launches but still no change.

This is what I have so far.

${SegmentFile}

${SegmentPreExec}
ExecWait 'RegSvr32 /S "$AppDirectory\sfFavorites.dll"'
ExecWait 'Regsvr32 /S "$AppDirectory\sfTransferQueue.dll"'
ExecWait 'Regsvr32 /S "$AppDirectory\sfFavoritesShellExtension.dll"'
ExecWait 'Regsvr32 /S "$AppDirectory\sfPidlStorage.dll"'
ExecWait 'Regsvr32 /S "$AppDirectory\sfFTPShellExtension.dll"'
!macroend

${SegmentPostPrimary}
ExecWait 'RegSvr32 /U /S "$AppDirectory\sfFavorites.dll"'
ExecWait 'Regsvr32 /U /S "$AppDirectory\sfTransferQueue.dll"'
ExecWait 'Regsvr32 /U /S "$AppDirectory\sfFavoritesShellExtension.dll"'
ExecWait 'Regsvr32 /U /S "$AppDirectory\sfPidlStorage.dll"'
ExecWait 'Regsvr32 /U /S "$AppDirectory\sfFTPShellExtension.dll"'
!macroend

Edit:
Ok I forgot to state I did notice that the 2.1 Launcher Removes the "PortableApps.comLauncherCustom.nsh" from the Source folder to The launcher folder and its now named "Custom.nsh". Not sure if that is the problem or not.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 10 months ago
Joined: 2007-04-15 21:08
Custom.nsh, PrePrimary

Read the 2.1 release notes in the manual and you'll see the change of location explained.

PrePrimary is the place it should go. It should not go in PreExec.

DLL server registration is a very troublesome subject. You may need admin rights or you may not.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Log in or register to post comments