- NSIS Discussion
- Need Quick Criticism... On a Script.
Archive: Need Quick Criticism... On a Script.
Tolwyn
25th April 2003 18:14 UTC
Need Quick Criticism... On a Script.
Ok. I was being very careful creating this with the help of HM NIS Edit.
I defined a variable to Hard Code the $Programfiles directory, as I don't want that to change (and don't think I can have the user change it as the files that go here are mutually exclusive of the $INSTDIR folder).
The files are INSTALLING okay.
I THINK I have the Start Menu shortcuts working okay.
The problem, I think, is that the Uninstaller is not removing the appropriate files deposited into the $INSTDIR folder, nor is it removing the $SMPROGRAMS shortcuts, either (or the folder that the user specified).
Could someone take a quick gander at the script and let me know where I dicked up? :)
The script is to install plane skins into the appropriate folders after the user specifies the game install folder (since I don't know how to populate a variable by checking their Registry for the game, yet).
However, the administrative information files should NOT go into the game folder (that's why I have specified/hardcoded the $PROGRAMFILES\${PGINST} folder for the basic ReadMe, HomePage URL, etc).
Thanks, guys (and gals?)... I apprecaite it in advance.
Tolwyn
26th April 2003 05:04 UTC
Bump! Please? :)
Joel
26th April 2003 15:22 UTC
I didn't find possible errors.
Maybe this suggestions.
1. The "LicenseBkColor 0x00e0e0e0" it's an invalid color format.
The LicenseBkColor accept rrggbb format. In your case: "e0e0e0"
2. Instead:
Delete "$INSTDIR\Paintschemes\skins\bf109e4\JG77512Bf109E4.bmp"
Delete "$INSTDIR\Paintschemes\skins\bf109f4\JG77512Bf109F4.bmp"
Delete "$INSTDIR\Paintschemes\skins\bf109g2\JG77512Bf109G2.bmp"
Delete "$PROGRAMFILES\${PGINST}\7jg77_readme.txt"
Delete "$PROGRAMFILES\${PGINST}\uninst-7jg77skins.exe"
Delete "$PROGRAMFILES\${PGINST}\7-JG77 Black Eagles.url"
Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\7-JG77.lnk"
Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall.lnk"
Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Read Me.lnk"
Way not:
RMDir /r "$INSTDIR\"
RMDir /r "$PROGRAMFILES\${PGINST}"
RMDir /r "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}"
;Will remove all with the parameter /r and the folder
Tolwyn
26th April 2003 16:56 UTC
Since the skins are being installed into a folder that was created by a game, I don't/can't delete the folder, only the specific files installed during this installation.
At any rate, there is an error in the script as the UNINSTALLER is not uninstalling the *.bmp files, or the Start Menu entries. I can't figure out why.
So this would be correct on the color thing:
LicenseBkColor 0x0e0e0e0
Or just 0xe0e0e0 ?
Or just e0e0e0 ?
I'm using the Hex color string, but don't know the format.
Joel
26th April 2003 17:06 UTC
LicenseBkColor E0E0E0
:)
But why, in my opinion, left files behind?
Delete all the files, folder and sub's in the $INSTDIR.
Tolwyn
26th April 2003 17:14 UTC
Uh, because the game has already installed its default skins there.
Other people have put THERE skins there, etc.
It would be very malignant of me to remove more than only the files that *I* installed.
Joel
26th April 2003 17:30 UTC
got it, dude ;)
deguix
26th April 2003 18:35 UTC
I checked you file at this morning and these are the results:
1)This line below is wrong:
LicenseBkColor 0x00e0e0e0
According to documentation, the form to use is RRGGBB, not 0x00RRGGBB, so is:
LicenseBkColor E0E0E0
So Lobo Lunar is right here.
2)Another line wrong:
WriteIniStr "$PROGRAMFILES\${PGINST}\7-JG77 Black Eagles.url" "InternetShortcut" "URL" "http://www.7jg77.com"
The right way to create shortcuts to webpages is:
CreateShortCut "$PROGRAMFILES\${PGINST}\7-JG77 Black Eagles.url" "http://www.7jg77.com"
3)Instead of (in Section Uninstall):
Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\7-JG77.lnk"
Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall.lnk"
Delete "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Read Me.lnk"
Should be:
!insertmacro MUI_STARTMENU_DELETE_BEGIN "$var"
Delete "$PROGRAMFILES\$var\7jg77_readme.txt"
Delete "$PROGRAMFILES\$var\uninst-7jg77skins.exe"
Delete "$PROGRAMFILES\$var\7-JG77 Black Eagles.url"
!insertmacro MUI_STARTMENU_DELETE_END
If you do this above, remove the lines:
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PGINST}" "NSIS:StartMenuDir" ;in Section Uninstall
and
CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}" ;in Section "Full Installation"
4)And a question: For what you want the Components Page if have only one section that is show?
Tolwyn
26th April 2003 18:47 UTC
For #4:
The script isn't final yet.
There will be a choice to install 512x512 skins, 1024x1024 skins, Allied skins, Axis Skins, or all.
Just haven't finished the sections yet.
That reminds me...
Will the uninstaller know what to delete automatically depending upon the installation, or do I have to have different sections for the uninstaller, too?
Is the uninstaller dynamically created based upon the installation?
deguix
26th April 2003 19:04 UTC
Is the uninstaller dynamically created based upon the installation?
No. You have to put what files you want to remove, reg keys to delete...
I have to have different sections for the uninstaller, too?
You cannot have different sections for uninstall yet (planned to this version of NSIS, see TODO.txt in NSIS folder for "to do list").
kichik
27th April 2003 17:09 UTC
Deguix, WriteIniStr works too. Open up a .url file and you'll see this inside of it.
The uninstaller code is compiled ahead but the uninstaller itself is generated dynamically. The exe header is first written, then the precompiled datablock (along with the script, files, headers, etc.) and then the icons are replaced.
Your problem with the uninstall is that $INSTDIR is wrong. $INSTDIR isn't transferred from the installer (unless you script it this way), instead the directory that the uninstaller is in is used as $INSTDIR.
Tolwyn
28th April 2003 04:29 UTC
Ok.
Kichik...
Based upon that information, where should the OUT path be for the uninstaller?
kichik
28th April 2003 14:11 UTC
Wherever you want it to be as long as you make sure you have the right $INSTDIR. That means that if your installer's $INSTDIR is C:\instdir and you put the uninstaller in C:\instdir\uninstall\uninstaller.exe then you'll have to use GetParent to get the right $INSTDIR, or just use Delete ..\file.exe, etc.
Tolwyn
28th April 2003 19:06 UTC
Oh god my head hurts.