Yaakov Selkowitz [Tue, 10 Aug 2010 20:38:01 +0000 (20:38 +0000)]
Fix compatibility with GCC 4.x.
* Makefile.am (setup_LDFLAGS): Pass -static to compiler instead of
linker so that libgcc is statically linked as well.
(autoload.o): Disable optimization.
* localdir.cc (browse_cb): Fix "jump to case label crosses
initialization" error.
* mklink2.cc (sfli): Fix "non-local variable uses anonymous type"
warning.
* ntdll.h: Fix "redeclared without dllimport attribute: previous
dllimport ignored" warnings.
* package_message.h (display): Fix "'exit' was not declared in this
scope" error.
Jon TURNEY [Thu, 29 Jul 2010 13:12:01 +0000 (13:12 +0000)]
* resource.h (IDD_POSTINSTALL, IDC_POSTINSTALL_EDIT): Add
resource identifiers for postinstall results page.
* res.rc (IDD_POSTINSTALL): Add dialog resource for postinstall
results page.
* postinstallresults.h: New file.
* postinstallresults.cc: New file.
* main.cc (main_display): Add a PostInstallResultsPage to the
wizard.
* Makefile.am (setup_SOURCES): Add new files.
* threebar.cc (OnMessageApp): Allow WM_APP_POSTINSTALL_THREAD_COMPLETE
to select the next page shown.
* postinstall.cc (do_postinstall_thread)
(do_postinstall_reflector): Collect results of running scripts
and compose a reporting message which we pass to the postinstall
results page. Select postinstall results page next if there are
results to show, otherwise desktop setup page as before.
* script.cc (run): Don't rename as .done scripts which didn't run
successfully.
Jon TURNEY [Thu, 29 Jul 2010 13:10:46 +0000 (13:10 +0000)]
* postinstall.cc (do_postinstall_thread)
(do_postinstall_reflector): Collect results of running scripts
and compose a reporting message which we pass to the postinstall
results page. Select postinstall results page next if there are
results to show, otherwise desktop setup page as before.
* PickPackageLine.cc (PickPackageLine::{click,set_action}):
Don't trigger automatic package selection when clicking on
packages or categories on chooser screen.
* PickCategoryLine.cc (PickCategoryLine::click): No more need to
prepare for automatic package selection with markUnVisited().
* res.rc: Drop "Warning!" from caption of Resolve Dependencies
screen.
Dave Korn [Sat, 17 Apr 2010 12:36:46 +0000 (12:36 +0000)]
* root.cc (RootPage::OnNext): Don't construct a packagedb here nor
do deferred initialisation of static packagedb::task.
* source.cc (save_dialog): Don't construct a packagedb here, and
set static packagedb::task directly instead of chosen_db_task.
* package_meta.cc (packagemeta::action_caption): Don't bother to
construct a packagedb here, just access packagedb::task directly.
* package_db.cc: Move 'static members' comment near static members.
(chosen_db_task): Delete.
* package_db.h (chosen_db_task): Don't declare extern.
(packagedb): Extend comments on class.
Dave Korn [Tue, 13 Apr 2010 17:49:11 +0000 (17:49 +0000)]
* PickView.h (PickView::set_vscroll_info): Add prototype.
(PickView::hasClientRect): Rename from this ...
(PickView::hasWindowRect): ... to this ...
(PickView::lastClientRect): ... and from this ...
(PickView::lastWindowRect): ... to this.
* PickView.cc (PickView::PickView): Adjust member init to match.
(PickView::set_vscroll_info): Abstract code to set vertical scroll
bar proportions from ...
(PickView::list_click): ... here. Call it. Fix comment typo.
(PickView::WindowProc): Update all renamed variables in WM_SIZE
case, and check also for a y delta, calling set_vscroll_info if so.
* README (HOW TO BUILD): Mention mingw-lib{gcrypt,lzma}-devel.
* res.rc (IDD_DESKTOP): Move Installation Status line,
IDC_STATUS_HEADER and IDC_STATUS up 20 units, make IDC_STATUS text
20 units taller and 40 units wider so that IDS_REBOOT_REQUIRED
message fits the screen.
* res.rc (IDD_SPLASH): Bump copyright years in IDC_SLASH_COPYR to
"2000-2010".
* install.cc (create_allow_protected_renames): New function to
create AllowProtectedRenames registry entry.
(Installer::installOne): Call create_allow_protected_renames if former
call to MoveFileEx was successful.
Charles Wilson [Tue, 30 Mar 2010 23:55:19 +0000 (23:55 +0000)]
Use external crypto libraries
* Makefile.am: Remove local libgcrypt and libgpg-error
source directories from AM_CPPFLAGS.
* configure.ac: Remove libgcrypt and libgpg-error subdirs
from AC_CONFIG_SUBDIRS. Remove now-unnecessary cruft.
* doconfigure: Specify gcc-3 and g++-3. Set PATH when $build
is cygwin, so that correct (mingw) libgcrypt and libgpg-error
config scripts can be used.
libgpg-error/: Remove all.
libgcrypt/: Remove all.
Charles Wilson [Sun, 14 Mar 2010 17:45:18 +0000 (17:45 +0000)]
Support xz and lzma decompression via liblzma
* Makefile.am: Add -DLZMA_API_STATIC to AM_CPPFLAGS,
-lzma to setup_LDADD, and -static-libtool-libs to
setup_LDFLAGS. Update setup_SOURCES.
* compress.cc: Update includes.
(compress::decompress): Use compress_xz rather than
compress_lzma; compress_xz supports both xz and lzma
decompression.
* compress_xz.h: New.
* compress_xz.cc: New.
* compress_lzma.h: Removed.
* compress_lzma.cc: Removed.
* lzma-sdk/LzmaDec.c: Removed.
* lzma-sdk/LzmaDec.h: Removed.
* lzma-sdk/Types.h: Removed.
Corinna Vinschen [Mon, 15 Feb 2010 17:44:11 +0000 (17:44 +0000)]
* filemanip.cc (transform_chars): Drop function.
(mklongpath): Call mbrtowc in a loop rather than just mbstowcs.
Transform characters on the fly. Fold multiple backslashes into one.
Drop trailing backslash.
Dave Korn [Mon, 15 Feb 2010 00:45:01 +0000 (00:45 +0000)]
* choose.cc (ChooserPage::PlaceDialog): Only skip resizing window
in fully-unattended mode, not chooser-only mode.
(ChooserPage::OnUnattended): Return appropriate status to run page
or not according to kind of unattended mode.
* choose.h (ChooserPage::OnUnattended): Remove inline implementation
and retain prototype only.
* main.cc (PackageManagerOption): New boolean option.
(main): Take it into account when setting unattended_mode.
* proppage.cc (PropertyPage::DialogProc): Use new enum type when
setting unattended_mode.
* state.cc (unattended_mode): Change from bool to enum attend_mode.
* state.h (enum attend_mode): Declare new enum type.
(unattended_mode): Update extern declaration to use it.
* desktop.cc (make_link): Use 0 default permissions when creating files
and directories.
* download.cc (download_one): Ditto.
* ini.cc (do_remote_ini): Ditto.
* localdir.cc (offer_to_create): Ditto.
* filemanip.cc (nt_wfopen): Use Windows default permissions if perms
is set to 0.
* mkdir.cc (mkdir_p): Ditto if mode is set to 0.
* desktop.cc (make_link): Preserve old way of doing things when is_legacy.
(make_cygwin_bat): Ditto.
(save_icon): Ditto.
* mount.cc (read_mounts): Ditto.
(set_root_dir): Ditto.
* root.cc (load_dialog): Ditto.
(save_dialog): Ditto.
* install.cc (Installer::installOne): Don't install anything if there is no
canonical file associated with source.
(do_install_thread): Set up old-style registry entries if is_legacy rather than
just keying on whether this is Windows NT.
* io_stream_file.cc (io_stream_file::exists): Redefine "exists" to mean "it's a
file".
* archive_tar.h (archive_tar_file::read_something): New member.
* archive_tar_file.cc (archive_tar_file::archive_tar_file): Don't reset state
unless we've actually read something.
(archive_tar_file::read): Set read_something variable here to indicate that
we've read something from the tar file.
* main.cc (dyn_AttachConsole): Make static.
(dyn_GetLongPathName): New variable.
(set_dynaddr): New function.
(set_cout): Don't set dyn_AttachConsole here.
(set_legacy): Don't attempt to call function which does not exist in older
versions of NT.
(main): Call set_dynaddr to set dynamic load addresses.
* ini.h: Use is_legacy to control setup.ini names.
* main.cc (set_legacy): New function.
(main): Call set_legacy with program name to determine if this is supposed to
be an installation of the legacy version of cygwin. Issue a warning on attempt
to install legacy on Windows NT class system.
Corinna Vinschen [Fri, 18 Dec 2009 11:59:54 +0000 (11:59 +0000)]
Throughout, revert prototypes and methods set_mtime_and_mode to
set_mtime and only care for the file timestamp.
Throughout, accommodate additional mode_t parameter in call to
io_stream::open.
* IOStreamProvider.h (IOStreamProvider::open): Add mode_t parameter.
* archive.cc (archive::extract_file): Reorder creation of in and tmp
to get the file mode from the tar archive earlier. Call io_stream::open
with additional mode from tar archive. Accommodate reversion to
set_mtime.
* filemanip.cc (nt_wfopen): Remove retry loop. Instead initialize
OBJECT_ATTRIBUTES with matching POSIX perms according to incoming
perms to create correct ACL on file creation. Remove subsequent call
to nt_sec.SetPosixPerms.
* io_stream.cc (io_stream::open): Take additional mode_t parameter
and connect through to IOStreamProvider's open.
* io_stream.h (io_stream::open): Add mode_t parameter.
* io_stream_cygfile.cc (CygFileProvider::open): Ditto.
(io_stream_cygfile::io_stream_cygfile): Ditto. Call nt_wfopen with
incoming mode_t parameter. Make sure .exe and .dll files always
have execute permissions set.
(io_stream_cygfile::set_mtime): Remove retry loop and open file with
just GENERIC_WRITE access.
* io_stream_cygfile.h (io_stream_cygfile::io_stream_cygfile): Add mode_t
parameter.
* io_stream_file.cc (FileProvider::open): Ditto.
(io_stream_file::io_stream_file): Ditto. Call nt_wfopen with incoming
mode_t parameter.
* io_stream_file.h (io_stream_file::io_stream_file): Add mode_t
parameter.
* io_stream_memory.h (class io_stream_memory): Remove mode member.
Just return 0 from get_mode.
* mkdir.cc (mkdir_p): Remove retry loop. Instead initialize
OBJECT_ATTRIBUTES with matching POSIX perms according to incoming
perms to create correct ACL on file creation. Remove subsequent call
to nt_sec.SetPosixPerms.
* mklink2.cc (mkcygsymlink_nt): Remove retry loop. Instead initialize
SECURITY_ATTRIBUTES with matching POSIX perms to create correct ACL on
file creation.
* win32.cc (NTSecurity::GetPosixPerms): New function to generate
POSIX ACL. Default to current owner and current primary group for
owner/group permissions.
(NTSecurity::SetPosixPerms): Let GetPosixPerms create the DACL.
(NTSecurity::setAdminGroup): Set groupSID to admins SID if successful.
(NTSecurity::setDefaultSecurity): Store user SID in ownerSID member.
Default groupSID to original primary group.
* win32.h (struct acl_t): Define here.
(class NTSecurity): Rename ownerSID and groupSID to cr_ownerSID and
cr_groupSID. Change throughout. Add members ownerSID and groupSID.
Declare new method GetPosixPerms.
Corinna Vinschen [Wed, 16 Dec 2009 17:15:43 +0000 (17:15 +0000)]
* UserSettings.cc (UserSettings::open_settings): Never add more than
one slash.
* filemanip.cc (tfx_chars): Align to Cygwin's transformation table.
* localdir.cc (LocalDirSetting::save): Call mkdir_p with DOS path.
Dave Korn [Tue, 8 Dec 2009 22:26:44 +0000 (22:26 +0000)]
* localdir.cc (offer_to_create): New function.
(browse_cb): Handle selection changed and validate failed
callbacks, and call offer_to_create where appropriate.
(browse): Set new dialog style flags in browser info.
(LocalDirPage::OnNext): Replace call to mkdir_p with offer to
create or error message dialog display, allow proceeding to
chooser even if local dir does not exist in unattend mode or
if user insists, and fix small memory leak.
* res.rc (IDS_MAYBE_MKDIR, IDS_CANT_MKDIR, IDS_NO_CWD): Define new
string resources.
* resource.h (IDS_MAYBE_MKDIR, IDS_CANT_MKDIR, IDS_NO_CWD): Define
corresponding resource ID numbers.
Dave Korn [Thu, 3 Dec 2009 04:59:46 +0000 (04:59 +0000)]
(ChooserPage::createListview): When nothing is found in the "All"
category, pass an empty static dummy category object to the PickView
constructor, instead of trying to dereference not-found iterator.
Dave Korn [Sun, 22 Nov 2009 02:20:15 +0000 (02:20 +0000)]
* package_meta.cc (CategoryOption): New StringOption for '-C'.
(parseNames): New helper subroutine abstracts string parsing from ...
(packagemeta::isManuallyWanted): Use it, and check for category names
from CategoryOption as well as individual package names.
* package_db.cc (packagedb::fillMissingCategory): Don't check for
manually-wanted packages until after initialising all the categories.
Dave Korn [Wed, 4 Nov 2009 19:39:05 +0000 (19:39 +0000)]
* site.cc: Add #include of BoolOption header from libgetopt.
(OnlySiteOption): New BoolOption for command-line -O option.
(get_site_list): Respect BoolOption by not downloading mirror
list, nor using nor updating cached mirrors.
* localdir.cc (browse): Make title text depend on what we do.
(LocalDirPage::OnNext): If we plan to download, try to create directory
before cd'ing into it.
* mkdir.cc: Include sys/stat.h unconditionally.
(mkdir_p): Add S_IFDIR flag in call to nt_sec.SetPosixPerms.
* win32.cc: Include sys/stat.h.
(NTSecurity::SetPosixPerms): Add CREATOR OWNER, CREATOR GROUP, and
Everyone inheritance-only entries when setting a directory DACL.
(NTSecurity::initialiseWellKnownSIDs): Create SIDs for CREATOR OWNER and
CREATOR GROUP.
* win32.h (class NTSecurity): Add members ownerSID and groupSID.
* root.cc (string orig_root_dir): New variable.
(check_if_enable_next): Show warning against installing Cygwin into disk root
only if the root directory has actually been changed.
* res.rc: Make the root dir warning a bit more meaningful, and refrain from
using uppercase.
* choose.cc (ChooserPage::OnBack): Revert to non-maximized when returning to
mirror from package selection.
Dave Korn [Fri, 18 Sep 2009 15:40:49 +0000 (15:40 +0000)]
* site.cc (get_site_list): Use empty string if user settings
return NULL pointer for cached mirrors list.
(SiteSetting::getSavedSites): Do nothing if user settings return
NULL pointer for last mirror URL.
Dave Korn [Wed, 1 Jul 2009 07:50:07 +0000 (07:50 +0000)]
* PickView.h (PickView::total_delta_x): New int member.
(PickView::set_header_column_order): Add prototype.
* PickView.cc (PickView::set_header_column_order): New function,
broken out from ...
(PickView::set_headers): ... here. Call it.
(PickView::init_headers): Apply total_delta_x to last_col width.
(PickView::PickView): Initialise new total_delta_x member to zero.
(PickView::WindowProc): Use set_header_column_order to find and
adjust final column for both sets of headers.
* SourceSetting.cc (SourceSetting::SourceSetting): Restore proper remembrane of
last source setting.
* choose.cc (ChooserPage::ChooserPage): Potentially retrieve dialog placement
info.
(ChooserPage::~ChooserPage): Save geometry settings if the user moved or
resized the page.
(ChooserPage::PlaceDialog): Rename from MaximizeDialog. Accommodate changed
user placement settings.
(ChooserPage::OnActivate): MaximizeDialog -> PlaceDialog.
(ChooserPage::OnNext): Ditto.
* choose.h (ChooserPage::~ChooserPage): Define.
(ChooserPage::cmd_show): Delete.
(ChooserPage::saved_geom): New field.
(ChooserPage::window_placement): Ditto.
(ChooserPage::pre_chooser_placement): Ditto.
(ChooserPage::PlaceDialog): Rename from MaximizeDialog.
* ConnectionSetting.cc (ConnectionSetting::ConnectionSetting): Remove old code
which no longer makes sense when run from a constructor.
* SourceSetting.cc (SourceSetting::SourceSetting): Ditto.
* localdir.cc (LocalDirSetting::LocalDirSetting): Ditto. Fix typo which caused
saved settings to be ignored.
Corinna Vinschen [Sun, 28 Jun 2009 10:26:14 +0000 (10:26 +0000)]
* desktop.cc (DesktopSetupPage::OnInit): Drop CoInitialize call here.
* main.cc (main_display): Use InitCommonControlsEx rather than
InitCommonControls per MSDN. Call CoInitializeEx and create IShellLink
instance here to workaround a problem on Windows 7. Release IShellLink
instance and call CoUninitialize on exit.
* mklink.cc (sl): Change to global variable. Drop call to
CoCreateInstance here. Check if sl is valid before using it.
Preliminary option handling revamp. Throughout, change load/save methods to
constructors/destructors which use new UserSettings methods. Do not inherit
from UserSetting class.
* KeysSetting.cc (ExtraKeysSetting *ExtraKeysSetting::global): Define.
(ExtraKeysSetting::ExtraKeysSetting): Initialize some class members use new
UserSettings methods.
(ExtraKeysSetting::~ExtraKeysSetting): Use new UserSettings method.
* Makefile.am (setup_SOURCES): Eliminate UserSetting.h and UserSetting.cc.
* UserSettings.cc: Complete rewrite. Implements new UserSettings class
methods.
* UserSettings.h: Complete rewrite. Defines new UserSettings class methods.
* crypto.cc (ExtraKeys): Delete.
(add_key_from_sexpr): Use ExtraKeysSetting::instance rather than ExtraKeys.
(verify_ini_file_sig): Ditto.
* io_stream.h (io_stream): Define virtual << operators.
* localdir.cc (localDir): Delete.
* main.cc: Include headers which declar new dynamically invoked classes.
(main_display): New function. Controls order of option setting and property
page setup. Add new class invocations to force option setting initializtion.
(main): Invoke new UserSettings class constructor to populate new settings
class. Call main_display() to do most of the setup work. Call Settings.save
() to save all settings.
* net.cc (theSetting): Delete.
* site.cc (SiteSetting::save): Record whether we've saved the information
already.
(get_site_list): Just use value returned from new UserSettings method rather
than parsing a file.
(SiteSetting::getSavedSites): Ditto.
(write_cache_list): Use UserSettings operator to store mirror cache.
(save_cache_file): Ditto.
* source.cc (theSetting): Delete.
* win32.h: gcc-4 accommodation.
Dave Korn [Fri, 26 Jun 2009 15:15:52 +0000 (15:15 +0000)]
* res.rc (SETUP_STANDARD_DIALOG_W, SETUP_STANDARD_DIALOG_H,
SETUP_SMALL_DIALOG_W, SETUP_SMALL_DIALOG_H): Add constant defines
for dialog sizes.
(SETUP_STANDARD_DIALOG_DIMS, SETUP_SMALL_DIALOG_DIMS): Add helper
macros for (W,H) pairs of dimensions.
(SETUP_HEADICON_X): New global constant define.
(IDD_SOURCE, IDD_VIRUS, IDD_LOCAL, IDD_ROOT, IDD_SITE, IDD_NET,
IDD_INSTATUS, IDD_PROXY_AUTH, IDD_NET_AUTH, IDD_DESKTOP,
IDD_FTP_AUTH DIALOG, IDD_DROPPED): Use the above for dialog sizes,
horizontal rules and icon positioning.
(SETUP_KPCE_W): New define for radio-button size.
(SETUP_VIEWCAP_W, SETUP_VIEWCAP_X, SETUP_VIEW_W, SETUP_VIEW_X,
SETUP_EXP_X, SETUP_CURR_X, SETUP_PREV_X, SETUP_KEEP_X): Add defines
for right-aligned controls.
(SETUP_SEARCH_X, SETUP_SEARCH_W, SETUP_SEARCHTEXT_X,
SETUP_SEARCHTEXT_W, SETUP_CLEAR_X, SETUP_CLEAR_W): Likewise defines
for left-aligned controls.
(IDD_CHOOSE): Use all the above, and reformat with whitespace
between args for clarity.
* threebar.cc (ThreeBarProgressPage::ins_dialog): Move variable to more
appropriate class.
(ThreeBarProgressPage::MaximizeDialog): Move function to more appropriate
class.
(ThreeBarProgressPage::OnMessageApp): Remove MaximizeDialog calls.
* threebar.h: Remove maximize handling.
* choose.cc (ChooserPage::ins_dialog): New variable.
(ChooserPage::MaximizeDialog): New function.
(ChooserPage::ChooserPage): Remove unneeded handling of nCmdShow.
(ChooserPage::OnActivate): Maximize chooser page via MaximizeDialog.
(ChooserPage::OnNext): Revert chooser page to normal before returning.
* main.cc (main): Don't pass cmd_show to ChooserPage.
* propsheet.cc (PropSheetProc): Accommodate change in class for SetHwndDialog.
* script.cc (shells): Delete.
(cmd): Just assign to "cmd.exe" since we're always running on NT now.
(sanitize_PATH ): New function.
(init_run_script): Ensure that we're only called once. Strip environment of
non-pertinent stuff. Call sanitize_PATH to remove non-standard stuff from the
PATH. Set up a few standard environment variables.
Corinna Vinschen [Tue, 16 Jun 2009 10:45:21 +0000 (10:45 +0000)]
* mount.cc (create_install_root): Don't load mount table again.
(read_mounts_nt): Don't break loop, rather continue when not being
able to open "Cygwin" registry key.
* filemanip.cc (unlink): Rename from DeleteFileW. Take additional
parameter to indicate file type to unlink. Use in flags given to
NtCreateFile.
(DeleteFileW): Just call unlink from here with FILE_NON_DIRECTORY_FILE
flag.
(RemoveDirectoryW): Ditto with FILE_DIRECTORY_FILE flag.