PDA

View Full Version : very simple setupbuilder script



NewsArchive
04-29-2015, 03:32 AM
Hi,

Would anyone be willing to _share_ with me a SIMPLE setupbuilder script
that does the following:

I'm just deploying a single file (the EXE). It needs to go into a
proper windows approved location.

There are no data files but the EXE will create some. So, the install
needs to create the proper (windows approved) data folder and set up
appropriate icons to make sure the referenced EXE starts in that folder.

If you have a script that does at least those two things that you
wouldn't mind sharing that would be great.

Thanks,
Scott Ripley

NewsArchive
04-29-2015, 03:33 AM
Scott,

> So, the install needs to create the proper (windows approved) data
> folder

Is this a "per-user" or "per-machine" data folder? In other words, is your
program a true 'mixed-mode' application and all users on that machine have
their own set of data files or do all users share the same set of data?
Even if there is only one user, running the application elevated or
non-elevated might access completely different sets of data files.

This design decision is important because it determines how to create the
data folder/files.

Friedrich

NewsArchive
04-29-2015, 03:33 AM
Thanks for the clarification request Friedrich.

per-user for data will work okay.

But if user A installs and gets user A data folder, how would the icon
launch user B tomorrow with the user B data folder? Or does windows
manage that automatically?


Scott

NewsArchive
04-29-2015, 03:33 AM
> I'm just deploying a single file (the EXE). It needs to go into a
> proper windows approved location.
>
> There are no data files but the EXE will create some. So, the install
> needs to create the proper (windows approved) data folder and set up
> appropriate icons to make sure the referenced EXE starts in that folder.

Hi Scott,

FWIW, if you use our ProPath templates then you won't have to worry about
doing that in the installer.

Your app will create the data folders and files in the proper locations
when it is first ran.

You can even use our FirstDeploy technology to deploy data files that have
content into the proper locations (either at the "First Run" or again later
in a new release as needed).

Letting the EXE do the work makes sure it is always right (in the proper
context) and ProPath makes it easy.

http://www.clarionproseries.com/html/propath.html

Good luck on your projects!

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ProScan, ProImage, ProPath and other Clarion
developer tools!
www.seal-soft.com - The xProduct Clarion templates - xWordCOM, xToolTip,
xDataBackup Manager and more!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
04-29-2015, 03:34 AM
Thanks Charles.
I'm still trying to figure out the options - I'm pretty green in this
area and it's all still confusing to me.

Scott Ripley

NewsArchive
04-29-2015, 03:34 AM
> Thanks Charles.
> I'm still trying to figure out the options - I'm pretty green in this
> area and it's all still confusing to me.

No problem Scott.

It certainly can be confusing and tedious to implement (to say the
least<g). That is one reason we wrote ProPath.

Here is a link to a section of our online docs about Selecting A CSIDL
location that will give you some insight as to where the data goes (on
different OS's) and who can access it.

http://www.clarionproseries.com/propathhelp/index.html?selectingacsidl.htm

Some of the locations are slanted towards "per user" cases, some work with
the roaming profiles, etc.

If you want to follow the MS guidelines, then there are some basic rules:

1) Your app installs under the Program Files folder.

2) Your app should be manifested for the version of the OS that it is
installing for. Also unless you have a specific reason to elevate it, your
program should be manifested for AsInvolker".

3) Your app should also be digitally code signed.

4) The Windows folder and the Program Files folder tree should be
considered "read only". While an elevated installer CAN install files or
write to files in these directories, a non-elevated program can not.

5) Understand how your app runs. In XP days, everyone simply made their
accounts Administrator accounts to solve a lot of problems with
permissions. That does not work today.

Even if you are "Scott the Administrator", when you run a non-elevated app,
Windows will treat you as "Scott the User".

One place this can present problems for you is if you allow the user to run
your program at the end of the install.

Since the installer requires elevation to install under a modern OS, you
are installing as "Scott the Administrator". If you run your program at
the end of the install, then any personal CSIDL locations for the program
at runtime will point to the "Scott the Administrator" account.

However when you exit the program and restart it, Windows will run it as
"Scott the User" and any data you stored as "Scott the Administrator" will
not be seen.

The good news is that if you want to enable this feature, SetupBuilder has
an option to run your program non-elevated.

Basically you detect the OS to see if it is greater than XP and if so you
run your program non-elevated. However on a XP system you just run it
normally.

You can also take the easy way out and simply tell the user that the
program is installed and that they can run it from the shortcut.


BTW - if you do allow your program to write to any data file under the
Program Files directory (or in the Windows folder) then that write will be
"virtualized" into an entirely different folder. This virtualization
process seems to be rather hit or miss in how well it works, so the best
thing to do is simply play by the rules for all data and INI files.

Fortunately ProPath makes it easy to be sure that both the data and the INI
files go where they should go.


If your program is generating data that needs to be shared by multiple
users who login under different accounts on the same machine, then you will
most likely want those files to reside under the CSIDL_COMMON_DOCUMENTS or
the CSIDL_COMMON_DATA folders.

The rule of thumb there is that if the user needs to "see" the files, you
put it in a folder under CSIDL_COMMON_DOCUMENTS. If it is a file only used
by the program you put it under CSIDL_COMMON_APPDATA.


ProPath also makes it easy to have a mix of both public and private files.

So (for example) if you want the INI files (or some data files) to be used
to store data or settings for each user individually, then you would put
that under the CSIDL_PERSONAL folder (if they need to see the files) or
under one of the other APPDATA CSIDL folders for files only needed by the
program.

ProPath will then take care of pointing the paths to the correct folders at
runtime for you - no matter what the OS.

You can also have a combination of files on a network share and files on
the local machine (typical in a multi-user install).


I know a lot of developers have put off dealing with these issues for a
long time, but as each new version of the OS comes along the security
issues are only going to get tighter. So generally it is easier to just do
the right thing and play along with the band<g>.

Regardless of what type of installation you need to support, ProPath was
designed to handle it.

It also has a lot of other nice features such as being able to run
procedures or install files on the "first run", deploy files on demand,
support multiple data sets (great for providing demo data or making it
possible to access previous years data), giving your users a button to open
Windows Explorer directly to the data folders, plus a lot more.

BTW - it also has full support for CapeSoft's FM2 and FM3 templates.

One other nice features is a Developer Mode. This allows you to run and
test your apps on your local machine without messing up your own data
structures and it is a great way to be able to work with different customer
data sets that may be sent to you.

I hope this helps!


:-)

Charles






--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ProScan, ProImage, ProPath and other Clarion
developer tools!
www.seal-soft.com - The xProduct Clarion templates - xWordCOM, xToolTip,
xDataBackup Manager and more!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
04-29-2015, 03:35 AM
> 2) Your app should be manifested for the version of the OS that it is installing for.

That should have said for the "highest" version of the OS that it is
installing for.

For example if you are manifested for Windows 10, then the app will run
correctly on older OS versions too.

Likewise your installer itself needs to be manifested for the highest
version of the OS you are installing for.

This is one reason that it is very important to keep your SetupBuilder
subscription up to date. That way Friedrich takes care of all the heavy
lifting for us there and all you need to do is rebuild the installer with
his latest release and you are ready to support the latest OS versions.


:-)

Charles



--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ProScan, ProImage, ProPath and other Clarion
developer tools!
www.seal-soft.com - The xProduct Clarion templates - xWordCOM, xToolTip,
xDataBackup Manager and more!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
04-29-2015, 03:35 AM
Thanks for all this Charles!
I'm going to have to re-read and study this a good bit...

Scott Ripley

NewsArchive
04-29-2015, 10:23 AM
Scott,

Exactly what Charles said <g>.

Friedrich