Skip to content
⌘ NSIS Forum Archive

Naive Newbie Question

7 posts

esoft#

Naive Newbie Question

I'm totally new to this install stuff, and I've read the manual, looked
over the FAQ's, searched the forums, and perused all the examples I
could find, but am still stumped.

I have this program, say uf.exe, created in Visual Basic 6.0.

I want it to run in XP, Win 7, and Win 8.

There is one .pdf file that it uses, uf.pdf.

I would like an installer that:

1. Installs the .exe and .pdf in an appropriate default place,
but also would let the user choose a different place.

2. Installs the .dll's and .ocx's that are needed.
The .ocx and .dll files are:
AcroPDF.dll
ASYCFILT.DLL
COMCAT.DLL
COMDLG32.OCX
GdiPlus.dll
msvbvm60.dll
MSWINSCK.OCX
OLEAUT32.DLL
OLEPRO32.DLL

3. Creates a register entry for HKCU/Software/UfCo/uf, where
the program can store information about itself.

4. Create a desktop shortcut to the executable uf.exe program.

5. Has an uninstall routine that at least clears out the registry
entries, the program and .pdf, and the desktop shortcut.

Is there an example somewhere that shows me how to do this? Is someone
willing to make one? I can even pay someone (some) for it, I'm that stuck!
Anders#
I think OLEAUT32.DLL is a system file that you should not be messing with.

Name ufinst
OutFile ufinst.exe
RequestExecutionLevel admin
InstallDir "$ProgramFiles\UF"

Page Directory
Page InstFiles

Section
SetOutPath $instdir
File uf.exe
File uf.pdf
WriteUninstaller "$instdir\uninst.exe"
; Not creating desktop shortcut, they are evil
; Not writing to HKCU here because I used "RequestExecutionLevel admin" and we might be running as admin
; TODO: You should be able to find information about shared libraries and visual basic in the .chm help file
SectionEnd

Section Uninstall
Delete "$instdir\uf.exe"
Delete "$instdir\uf.pdf"
Delete "$instdir\uninst.exe"
RmDir "$instdir"
SectionEnd
is pretty basic and gets you half way there...
esoft#
partial success...

Thanks! That's a start, and gives me some idea of the general
outline of an .nsi file.

I still need to know about the .dll's and .ocx's, though, and
don't know what "shared libraries and visual basic in the .chm help file"
means. I presume "shared libraries" refers to the system's .dll's
and .ocx's? (I made the list up from the routines that the installer
that is bundled with VB6 packs up making its install package.)


I have tried to create registry entries, it fails, and I can give up
on that, it's not critical, and the program itself can create the
entries as it needs them.


Creating a desktop shortcut to the executable uf.exe program, however,
is critical. I don't know why you say it is "evil", but for what we're
doing, it is absolutely necessary. If I can't get the installer
to do it, then I'll have to find a different installer system to use.
Anders#
The MS guidelines say you should create a single shortcut in the start menu ($smprograms).

Why is it evil? Well, just think what peoples desktops would look like if all programs felt that they are so important that they have to have a desktop shortcut? And since I assume you want to install the application under program files that means that the installer will require admin rights which means that the NSIS script should execute "SetShellVarContext all" and that changes the $desktop variable to point to the all users/programdata profile and then you end up with a shortcut on every users desktop and a non-admin user cannot even delete it and that's why I'm calling it evil...

Checkout Appendix B in the helpfile for information about shared dll's and VB6.
esoft#edited
I don't know what "helpfile" you are referencing. There doesn't seem to be a helpfile or Appendix B in the NSIS Documentation. found it!


This is not for a consumer product, it is for a very small niche, where the program will be the primary purpose of the computer. If we can't put an icon on the desktop, we can't use it.
JasonFriday13#
CreateShortCut.

So you'll want something like this:
CreateShortCut "$DESKTOP\my_program_shortcut.lnk" "$INSTDIR\my_program.exe"
Note that as Anders has stated, $DESKTOP will change depending on what SetShellVarContext is set to ("current" is the default).