Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   using ReserveFile for exe files => they are not valid Win32 any more (http://forums.winamp.com/showthread.php?t=332568)

isawen 18th July 2011 09:32

using ReserveFile for exe files => they are not valid Win32 any more
 
Hi guys,

I'm facing a pretty strange case.
I have used the ReserveFile command to place an exe into the plugins directory, but after I extract it my tool could not be executed any more as windows says "is not a valid Win32 application".

code:

...
ReserveFile "${TOOL_EXE_DIR}\${TOOL_EXE_NAME}"
...
Function .onInit
InitPluginsDir
!insertmacro INSTALLOPTIONS_EXTRACT_AS "${TOOL_EXE_DIR}\${TOOL_EXE_NAME}" "${TOOL_EXE_NAME}"
FunctionEnd

.

What is happening with my exe? I see on the compilation that INSTALLOPTIONS_EXTRACT_AS is trying to write the RTL into the file. How can I extract the exe without changing it? (maybe another command?)


Thanks,
Isawen

isawen 18th July 2011 10:08

I was able to figure out the problem.
The extraction code should look like this
code:

Function .onInit

InitPluginsDir

File "/oname=$PLUGINSDIR\${TOOL_EXE_NAME}" "${TOOL_EXE_DIR}\${TOOL_EXE_NAME}"

FunctionEnd



I was thinking that ReserveFile placed somewhere the file and only the INSTALLOPTIONS_EXTRACT_AS macro could extract it, but after I read the macro definition I understand the purpose of ReserverFile.

Topic can be closed.


All times are GMT. The time now is 17:40.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.