WINAMP.COM | Forums > Developer Center > NSIS Discussion > Changing $TEMP path |
Last Thread
Next Thread
|
| Author |
|
|
Joost Verburg NSIS MUI Dev
Registered: Nov 2001 |
Use StrCpy in the .onInit function. |
||
|
|
|
scully13 Senior Member
Registered: Apr 2004 |
Ok, so what am I doing wrong? That's what I've been trying. I took the Basic.nsi script from the Modern UI folder and added: |
||
|
|
|
Joost Verburg NSIS MUI Dev
Registered: Nov 2001 |
You can't modify this variable, you should declare your own. |
||
|
|
|
thelliez Junior Member
Registered: Feb 2004 |
I would like to second this feature request. I am in a similar situation where I am not allowed to write to the C drive. |
||
|
|
|
Joost Verburg NSIS MUI Dev
Registered: Nov 2001 |
See the documentation about callback functions. |
||
|
|
|
scully13 Senior Member
Registered: Apr 2004 |
Modifying the $PLUGINSDIR doesn't really seem to solve the problem either. If I put a MessageBox as the very first thing in .onInit and then check the temp directory it has already written a file there (C:\Documents and Settings\andyg\Local Settings\Temp\nskC0.tmp). So, unless that temp file is there because I did a MessageBox it seems too late to change the plugins directory and use it as the temp folder. Is there a function before .onInit? |
||
|
|
|
Joost Verburg NSIS MUI Dev
Registered: Nov 2001 |
That isn't a file, it's a folder. Use it and it will be removed automatically (but don't forget to call InitPluginsDir). |
||
|
|
|
scully13 Senior Member
Registered: Apr 2004 |
It's actually a file for me. It's locked though, it won't even let me open it in Notepad. If I then click Ok on the MessageBox I get a folder after that with all my IO pages, bitmaps etc. I realize it renames itself everytime but in this instance I have a TMP file named nsbD3.tmp and then I get a nscD4.tmp folder after I click past the message box. I get the same result if I run the nsis20.exe install file. Both the temp file and folder do go away after the install is cancelled or completed. I'm running XP Pro SP1 if that matters. |
||
|
|
|
kichik M.I.A. [NSIS Dev, Mod]
Registered: Oct 2001 |
That's probably the solid compression buffer. Don't use solid comression if you don't want it to be created. __________________ |
||
|
|
|
scully13 Senior Member
Registered: Apr 2004 |
Ok, I switched to using non-solid compression and the .tmp file did go away so that must have been what was causing that. I had to change things using MUI_INSTALLOPTIONS_EXTRACT_AS to File so that I could copy them into the user defined temp folder and that worked ok. However, plugins (like InstallOptions.dll), ioSpecial.ini and the header and wizard bitmap still go to the temp folder under profiles for that user. How can I get it so that these files will go into the usr defined temp folder? I'm thinking something like "InitPluginsDir c:\usertemp" would be great. I realize I may have to delete the files myself once the install is finished. Thanks, |
||
|
|
|
kichik M.I.A. [NSIS Dev, Mod]
Registered: Oct 2001 |
You can call plug-ins the old fashioned way, with CallInstDLL. To avoid having to do that for every plug-in, you can get your first plug-in to change $PLUGINSDIR. $PLUGINSDIR is not changable from the script. __________________ |
||
|
|
|
scully13 Senior Member
Registered: Apr 2004 |
Are you saying that CallInstDLL will set the $PLUGINSDIR path or that my first plugin can somehow set the $PLUGINSDIR path? If the second is true is there an example of that somewhere? I've attached a modified version of Basic.nsi to illustrate what I'm trying. It ends up that the $PLUGINSDIR never gets set even after the call to CallInstDLL. The exdll.dll does get called though from the usertemp folder. The install runs but I have no idea where ioSpecial.ini and InstallOptions.dll are going.
|
||
|
|
|
kichik M.I.A. [NSIS Dev, Mod]
Registered: Oct 2001 |
The plug-in can change $PLUGINSDIR using the variables argument passed to its function. I suggest you simply examine what is passed in variables and see where the change is needed. The utility functions in exdll.h might help. __________________ |
||
|
|
|
scully13 Senior Member
Registered: Apr 2004 |
Awesome, I got the plug-in built and working. Here's what I did if anybody else is curious: I extract my DLL to whatever folder the user specifies on the command line and then call my DLL to change the PLUGINSDIR. Then I call InitPluginsDir from my script so that I can use the path and it also creates a unique folder under the user path, which is nice. Then I delete my DLL used to change the PLUGINSDIR and NSIS takes care of deleting the temp path it created and all the junk in it when the install finishes. I had to add a little code in .onInit but the rest of my script appears to work as is. If anybody wants more detail please ask. Thanks again kichik! |
||
|
|
|
thelliez Junior Member
Registered: Feb 2004 |
Do you mind posting a little bit more details about you made it happen? What does your dll like? |
||
|
|
|
scully13 Senior Member
Registered: Apr 2004 |
The DLL didn't take much. I just took exdll and added this code to myFunction: |
||
|
|
|
scully13 Senior Member
Registered: Apr 2004 |
Several of my customers have been using this plugin in my installs with no problems. It was being used to change the $PLUGINSDIR. So, I thought that I would post the plugin to the Archive just in case anyone else could use it. |
||
|
|
|
Last Thread Next Thread
|
WINAMP.COM | Forums > Developer Center > NSIS Discussion > Changing $TEMP path |
Forum Rules:
|