Archive: Launching PRC after install? And Delete dll?


Launching PRC after install? And Delete dll?
After installation, I have the following:

Function .onInstSuccess

SetPluginUnload manual
#free dll
System::Free 0

#remove dll
Delete "$INSTDIR\dll\Verify.dll"
RMDir /r "$INSTDIR\dll"

MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Would you like to install '$PRODUCT' to your palm device?" IDYES run_prc
Abort

run_prc:
Exec "$INSTDIR\myapp.prc"
FunctionEnd

2 questions:
1) The dll never gets deleted. Am I using the SetPlugingUnload function properly?

2) The Exec line doesn't do anything. I would like it to bring up the palm quickinstall application with the prc in it. Can the Exec function take parameters?

Thanks,

James


To use parameters with a exec call use this layout:

exec '"$INSTDIR\command.exe" parameters'


Vytautas

Thanks Vytautas, I had my quotes messed up and I was trying to escape them.

Here's the code to get a Palm PRC to load in the quickinstall if anyone is interested:

Function GetQuickInstallPath
SetOutPath "$INSTDIR\dll"
File bin\CondMgr.dll ; copy dll there
StrCpy $3 ${NSIS_MAX_STRLEN} ; assign memory to $0
System::Call 'CondMgr::CmGetHotSyncExecPath(t .r2, *i r3) i .r1'
DetailPrint 'Path: "$2"'

;fancy string dancing
StrCpy $3 "$2" -11
StrCpy $2 "$3QuickInstall.exe"
FunctionEnd

Function .onInstSuccess
Call GetQuickInstallPath

SetPluginUnload manual
#free dll
System::Free 0

#remove dll
Delete "$INSTDIR\dll\CondMgr.dll"
RMDir /r "$INSTDIR\dll"

MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Would you like to install '$PRODUCT' to your palm device?" IDYES run_prc
Abort

run_prc:
Exec '"$2" "$INSTDIR\myapp.prc"'
FunctionEnd

Now how come my dll doesn't get deleted?

james


To be able to delete CondMgr.dll you should make System.dll unload it first. This can only be done in the latest CVS version using the 'u' option. For example:

System::Call "some::thing(i 2) i .r2 ?u"


Thanks kichik! Is there some documentation on that yet? I'd like to learn how it works a little better. Does the '?u' make the commands: 'SetPluginUnload manual' and 'System::Free 0' obsolete?

Thanks again


There is System.txt and that's it for now.

'?u' does not make 'SetPluginUnload manual' and 'System::Free 0' obselete because it relates to another DLL. '?u' unloads CondMgr.dll while the other two make sure System.dll is unloaded.