|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 |
Junior Member
Join Date: Apr 2020
Posts: 2
|
Best practices for script design: ProgramFiles and user files
I'm developing my first installation package with NSIS. The application UI is developed in C# in VS2017 on Windows 10 and the install package was originally developed with Windows Installer. Because of limitations with Windows Installer, the user had to perform functions I wanted to handle in installation and I think I can do that with NSIS. I wish to install the application per computer with the program files placed in the current Program Files directory and user specific input/output data in the current user's Documents directory. Uninstall is to be provided for the program files but not for the data files. Once the installation is done for the first user with administrator rights, other users could install their own input/output data files, preferably with standard rights. First of all, I would welcome advice on whether this is a reasonable design plan and, secondly, I'm wondering how the script should be laid out to do this. Can it all be handled in a single script or is it necessary to develop separate scripts for the program files and the data files, which could then be embedded in a separate script for execution. I sincerely appreciate any advice you can give.
|
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Mixing ProgramFiles and user files in the same installer is not recommended.
The Microsoft guidelines say that you should install to ProgramFiles. When a user runs your application for the first time, the application itself should copy your template files from a shared location (%programfiles% or %programdata%) to the users profile. If you don't want to follow the rules, you can use a hack like GetUserShellFolderFromRegistry See also: - NSIS best practices IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Apr 2020
Posts: 2
|
That makes perfect sense and it can be done with the existing installer. Thanks for the lesson.
|
![]() |
![]() |
![]() |
|
Tags |
script design, windows 10 |
Thread Tools | Search this Thread |
Display Modes | |
|
|