PDA

View Full Version : Newbee needing help


jollyjoice
28th March 2004, 18:14
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

Joel
28th March 2004, 18:22
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?

deguix
28th March 2004, 18:47
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").

jollyjoice
29th March 2004, 17:26
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!

pengyou
29th March 2004, 18:07
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)

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

jollyjoice
30th March 2004, 17:01
3) Er, yes

jollyjoice
1st April 2004, 18:00
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: :(

Joost Verburg
1st April 2004, 18:21
Search the forum for info about URL files.

VegetaSan
2nd April 2004, 12:57
It's really easy :

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

VegetaSan
2nd April 2004, 13:00
without the "SectionEnd"

deguix
2nd April 2004, 23:08
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.

jollyjoice
26th April 2004, 18:14
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:

Joost Verburg
26th April 2004, 19:16
The icon set using MUI_ICON is invalid or you removed files from the Contrib\Graphics folder.

VegetaSan
27th April 2004, 08:42
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"

Joost Verburg
27th April 2004, 08:45
The location of the icon makes no difference.

VegetaSan
27th April 2004, 09:04
I know that .. but that really was the problem at my place

Joost Verburg
27th April 2004, 09:12
I think it must have been a typo :)

jollyjoice
27th April 2004, 18:21
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

Joost Verburg
27th April 2004, 18:31
Did you define MUI_ICON? If yes, that file in invalid. Otherwise the default icon file is missing, in that case reinstall NSIS.

jollyjoice
27th April 2004, 18:34
!define MUI_ICON "C:\csimu.ico"
!define MUI_UNICON "C:\simuun.ico"

Joost Verburg
27th April 2004, 18:36
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.

jollyjoice
27th April 2004, 18:46
they are icons. I made them and they have worked before

jollyjoice
27th April 2004, 19:05
sorry! whilst making them the same size I had chanded one of the names!! Silly me. workes now...

jollyjoice
8th May 2004, 11:19
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??

Joost Verburg
8th May 2004, 12:12
Use CopyFiles with full path names.

jollyjoice
8th May 2004, 14:06
how exactly? copyfiles "$INSTDIR\save\*.*" "C:\save backup" ??

Joost Verburg
9th May 2004, 09:58
Yes

jollyjoice
9th May 2004, 13:35
ok, now how do I add a section to the installer to restore tose saves from the ENDUSER's PC not mine??

Joost Verburg
9th May 2004, 15:43
Section "Restore"
CopyFiles $MYDOCS\save\*.* $INSTDIR
SectionEnd

jollyjoice
9th May 2004, 18:44
thanks, will give it a go!!

jollyjoice
26th May 2004, 18:00
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?

jollyjoice
27th May 2004, 19:21
same thing, it is not a problem with the rest of the script. HELP anybody???

kichik
28th May 2004, 08:42
See the MUI readme about custom functions (or something similar). The MUI uses .onGUIInit.

jollyjoice
28th May 2004, 18:06
setting the language is a custom function?

kichik
29th May 2004, 08:34
No, "Customize Modern UI Functions".

jollyjoice
29th May 2004, 14:04
ok, so how do i make the b/g image function to be called notusing .onguinit??

pengyou
29th May 2004, 17:38
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

jollyjoice
29th May 2004, 18:16
YEs! Thanks, it works!! codn't find that in my readme, sorry.

jollyjoice
30th May 2004, 16:19
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