Archive: Newbee needing help


Newbee needing help
Hi all,
These things will probobly be easy for an expert but I can't find a way to do them! Any help would be apreciated.
I have a nice installer going (http://chris.simutrans.com) but need some help on advancing it.
1) Can you add a texture to the modernUI, insead of the default windows coluorings?
2) How do you make an item to install ALWAYS cheacked, IE must be installed?
3) How do I do the background image thing? I have tryed ecery variation yet it still does not work!
Any ideas?
I will probobly think of some other things later...:D
Thanks
:eek:
Chris


1) Nope. That will be subclassing, meaning change the source code of NSIS.
2) Read about IfFileExists
3) What background image? The installer top corner?


1) If you mean a "theme", you have to change a lot the NSIS source code...
2) Use SectionSetFlags command inside .onSelChange function (if you mean "checked on components page").
3) See the example "${NSISDIR}\Contrib\BgImage.nsi" (if you really mean "background image").


1)I mean, instead of windows giving you a boring gray like all the other windows to use a bitmap or other image as a "texture"
2)I want the file to be un-unchekable if you get me. It cannot be uncheaked. They are the core files for the program.
3)I mean the full screen thingy, i have read that but it eather says there is an error in the script or makes it, but it doesnt actualy show up!


For (2) on your list, I think SectionIn and the RO parameter are what you are looking for. (See 4.6.1.4 in the NSIS manual)


1) As I told you, no. You'll have to change the source code.
2) Like pengyou saud.
3) There's a plugin, right?


3) Er, yes


any ideas
trying to add shortcuts to websites in users favorites? I have 3 set up, only 1 installs and it shows up as a shortcut not a link. any ideas?:confused: :(


Search the forum for info about URL files.


It's really easy :

CreateShortCut "$FAVORITES\Anime-Supreme.lnk" "http://www.anime-supreme.com"
SectionEnd


without the "SectionEnd"


VegetaSan, (TIP) don't forget, has an "Edit" button on the right corner part of each post, so you can edit the post if it has something wrong. The time limit for the edition is 3 hours after the posting.


Any ideas? This comes up when compiling:

Error: File doesn't exist or is an invalid icon file
Error in macro MUI_INTERFACE on macroline 61
Error in macro MUI_PAGE_INIT on macroline 3
Error in macro MUI_PAGE_WELCOME on macroline 5
Error in script "C:\Documents and Settings\Administrator\Desktop\Simutrans.nsi" on line 49 -- aborting creation process

The line in question is:

!insertmacro MUI_PAGE_WELCOME

What is going on????:weird:
Using NSIS v2
Very confused:confused:


The icon set using MUI_ICON is invalid or you removed files from the Contrib\Graphics folder.


I had the same problem once ... but when I copied the icon to my C: then It suddenly worked


!define MUI_ICON "C:\icon.ico"
!define MUI_UNICON "C:\icon.ico"

The location of the icon makes no difference.


I know that .. but that really was the problem at my place


I think it must have been a typo :)


ok, still no good. this is the full thing I think:

!insertmacro: MUI_PAGE_WELCOME
Error: File doesn't exist or is an invalid icon file
Error in macro MUI_INTERFACE on macroline 61
Error in macro MUI_PAGE_INIT on macroline 3
Error in macro MUI_PAGE_WELCOME on macroline 5
Error in script "C:\Documents and Settings\Administrator\Desktop\Simutrans.nsi" on line 49 -- aborting creation process


Did you define MUI_ICON? If yes, that file in invalid. Otherwise the default icon file is missing, in that case reinstall NSIS.


!define MUI_ICON "C:\csimu.ico"
!define MUI_UNICON "C:\simuun.ico"


That means that these files are invalid icon files. Note that bitmaps are not identical to icons, you'll have to use an icon editor.


they are icons. I made them and they have worked before


sorry! whilst making them the same size I had chanded one of the names!! Silly me. workes now...


copy files in uninstaller??
OK, I want to get the unistaller to copy the savefiles from folder "save" to a new folder "Save bakup" in mydocuments. I have tryed doing this as you would when programming the installer bit, the file compiles fine just it dosent actualy do it! Any ideas??


Use CopyFiles with full path names.


how exactly? copyfiles "$INSTDIR\save\*.*" "C:\save backup" ??


Yes


ok, now how do I add a section to the installer to restore tose saves from the ENDUSER's PC not mine??


Section "Restore"
CopyFiles $MYDOCS\save\*.* $INSTDIR
SectionEnd

thanks, will give it a go!!


ok, next. tryed the BG plugin again, it works fine but I get
!insertmacro: MUI_LANGUAGE
Error: Function named ".onGUIInit" already exists.
Error in macro MUI_FUNCTION_GUIINIT on macroline 2
Error in macro MUI_INSERT on macroline 11
Error in macro MUI_LANGUAGEFILE_BEGIN on macroline 4
!include: error in script: "C:\Program Files\NSIS\Contrib\Modern UI\Language files\English.nsh" on line 9
Error in macro MUI_LANGUAGE on macroline 5
Error in script "C:\Documents and Settings\admin2\Desktop\Simutrans.nsi" on line 61 -- aborting creation process

or a list of text thingys which havent worked and the installer is screwed. any ideas?


same thing, it is not a problem with the rest of the script. HELP anybody???


See the MUI readme about custom functions (or something similar). The MUI uses .onGUIInit.


setting the language is a custom function?


No, "Customize Modern UI Functions".


ok, so how do i make the b/g image function to be called notusing .onguinit??


From the MUI ReadMe:

If you want add your own code to functions inserted by the Modern UI, such as the .onGUIInit function and the Page functions, create your own function and let the Modern UI functions call them. Use the defines to define the name of your functions.

Example:

!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit

Function myGUIInit
...your own code...
FunctionEnd


YEs! Thanks, it works!! codn't find that in my readme, sorry.


how do you work the Compare functions? I wnat to get it to compare the current installer with the one on my website and download it if necessary, all i can get it to do is say "you are uptodate" or download it regardless